simplify puzzle data and auto run codegen

This commit is contained in:
Asuro
2025-03-14 01:33:38 +01:00
parent 97146664f2
commit de88190c47
9 changed files with 82 additions and 143 deletions

View File

@@ -28,7 +28,14 @@ set_property(TARGET PuzGameEngine PROPERTY CXX_STANDARD 17)
target_include_directories(PuzGameEngine PUBLIC)
# Game
file(GLOB_RECURSE sources_game game/*.cpp game/*.h gen/*.cpp gen/*.h)
add_custom_command(
COMMAND "${CMAKE_BINARY_DIR}/minidef.exe" "${CMAKE_SOURCE_DIR}/game/mini.def" "${CMAKE_SOURCE_DIR}/gen/"
DEPENDS "${CMAKE_SOURCE_DIR}/game/mini.def"
OUTPUT "${CMAKE_SOURCE_DIR}/gen/Generated.h" "${CMAKE_SOURCE_DIR}/gen/Generated.cpp"
COMMENT "Genrating from minidef"
)
file(GLOB_RECURSE sources_game game/*.cpp game/*.h gen/Generated.cpp gen/Generated.h gen/Def.h gen/Def.cpp)
file(GLOB source_singleheader dependency/tinygltf/stb_image.h dependency/tinygltf/stb_image_write.h dependency/tinygltf/json.hpp dependency/tinygltf/tiny_gltf.h)
add_library(PuzGame SHARED ${sources_game} ${source_singleheader} ${imgui_sources} ${imgui_backend_sdl})
set_property(TARGET PuzGame PROPERTY CXX_STANDARD 17)