diff --git a/apps/templates/zig/.gitignore b/apps/templates/zig/.gitignore new file mode 100644 index 0000000..e5a6443 --- /dev/null +++ b/apps/templates/zig/.gitignore @@ -0,0 +1,19 @@ +# ignore executables +* +!*.* +!*/ + +**/*.so +**/*.dll +**/*.exe +**/*.trace +**/*.js +**/*.wasm +**/*.wasm.map +**/*.data +**/*.html + +data/scripts/twnapi.lua +build/ +.zig-cache/ +zig-out/ diff --git a/apps/templates/zig/CMakeLists.txt b/apps/templates/zig/CMakeLists.txt index 4b2a38e..bdd25a6 100644 --- a/apps/templates/zig/CMakeLists.txt +++ b/apps/templates/zig/CMakeLists.txt @@ -10,12 +10,14 @@ add_subdirectory($ENV{TWNROOT} ${CMAKE_BINARY_DIR}/twn) cmake_path(GET CMAKE_SOURCE_DIR STEM LAST_ONLY GAME_PROJECT_NAME) put_townengine(${CMAKE_CURRENT_SOURCE_DIR}) +file(GLOB_RECURSE zig-sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.zig) + # TODO: support static build # TODO: propagate release switches add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/libgame.so COMMAND env zig build - DEPENDS ${TWN_TARGET} + DEPENDS ${TWN_TARGET} ${zig-sources} ) add_custom_target(