Some project structure fixes

This commit is contained in:
Colin Sames
2026-04-03 19:54:39 +02:00
parent ac9d2f8648
commit a321f757f2
7 changed files with 35 additions and 36 deletions

View File

@@ -2,8 +2,21 @@ add_executable(game
"src/main.cpp"
)
target_compile_features(game PRIVATE cxx_std_23)
target_link_libraries(game PRIVATE engine)
# On Windows with dynamic linking, copy SDL3.dll next to the game executable.
# $<TARGET_FILE_DIR:game> always resolves correctly regardless of build layout.
if(WIN32 AND SDL_LINK_TYPE STREQUAL "dynamic")
add_custom_command(TARGET game POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:SDL3::SDL3>
$<TARGET_FILE_DIR:game>
COMMENT "Copying SDL3.dll to game output directory"
)
endif()
# On Windows, use the WINDOWS subsystem (no console) for release only
if(WIN32)
if(CMAKE_BUILD_TYPE STREQUAL "Release")