Files
shweetandClaude Opus 5.5 465f75f6d7 Split the simulation from presentation into an SDL-free library
Sim holds one whole game (tick, snapshots, checksum) and talks to the screen only
through Cues, which the client's Scene plays and the server ignores. All drawing
moved to scene.cpp. Match takes this screen's wishes as request flags instead of
reading the menu, input and settings. The sim library builds without SDL and the
server links it, ready to run games itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 01:46:07 -05:00

30 lines
1.4 KiB
CMake

# The server, which runs games with the simulation library. Built as part of the game's desktop build, or on its own
# (for the VPS, without SDL):
# cmake -S server -B build-server -DCMAKE_BUILD_TYPE=Release && cmake --build build-server
cmake_minimum_required(VERSION 3.24)
project(smack_a_brother_server LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(EXTERNAL ${CMAKE_CURRENT_SOURCE_DIR}/../external)
if(NOT TARGET datachannel-static)
set(NO_MEDIA ON CACHE BOOL "" FORCE)
set(NO_EXAMPLES ON CACHE BOOL "" FORCE)
set(NO_TESTS ON CACHE BOOL "" FORCE)
add_subdirectory(${EXTERNAL}/libdatachannel ${CMAKE_BINARY_DIR}/libdatachannel EXCLUDE_FROM_ALL)
endif()
if(NOT TARGET sim)
include(${CMAKE_CURRENT_SOURCE_DIR}/../src/sim.cmake)
endif()
if(NOT TARGET simdjson)
add_library(simdjson STATIC ${EXTERNAL}/simdjson/singleheader/simdjson.cpp)
target_include_directories(simdjson SYSTEM PUBLIC ${EXTERNAL}/simdjson/singleheader)
target_compile_definitions(simdjson PUBLIC SIMDJSON_EXCEPTIONS=0)
endif()
add_executable(smack_a_brother_server server.cpp)
target_include_directories(smack_a_brother_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src)
target_link_libraries(smack_a_brother_server PRIVATE sim LibDataChannel::LibDataChannelStatic simdjson)
set_target_properties(smack_a_brother_server PROPERTIES OUTPUT_NAME smack-a-brother-server)