diff options
Diffstat (limited to 'cmake/DemoTools.cmake')
| -rw-r--r-- | cmake/DemoTools.cmake | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/cmake/DemoTools.cmake b/cmake/DemoTools.cmake new file mode 100644 index 0000000..8c589f1 --- /dev/null +++ b/cmake/DemoTools.cmake @@ -0,0 +1,48 @@ +# Build Tools Setup +# Configures asset_packer, seq_compiler, and tracker_compiler + +# Asset packer tool +if(DEFINED ASSET_PACKER_PATH) + set(ASSET_PACKER_CMD ${ASSET_PACKER_PATH}) + set(ASSET_PACKER_DEPENDS ${ASSET_PACKER_PATH}) +else() + add_executable(asset_packer tools/asset_packer.cc) + target_link_libraries(asset_packer PRIVATE procedural) + target_include_directories(asset_packer PRIVATE third_party) + set(ASSET_PACKER_CMD $<TARGET_FILE:asset_packer>) + set(ASSET_PACKER_DEPENDS asset_packer) +endif() + +# Sequence compiler tool +if(DEFINED SEQ_COMPILER_PATH) + set(SEQ_COMPILER_CMD ${SEQ_COMPILER_PATH}) + set(SEQ_COMPILER_DEPENDS ${SEQ_COMPILER_PATH}) +else() + add_executable(seq_compiler tools/seq_compiler.cc) + set(SEQ_COMPILER_CMD $<TARGET_FILE:seq_compiler>) + set(SEQ_COMPILER_DEPENDS seq_compiler) +endif() + +# Tracker compiler tool +if(DEFINED TRACKER_COMPILER_PATH) + set(TRACKER_COMPILER_CMD ${TRACKER_COMPILER_PATH}) + set(TRACKER_COMPILER_DEPENDS ${TRACKER_COMPILER_PATH}) +else() + add_executable(tracker_compiler tools/tracker_compiler.cc) + set(TRACKER_COMPILER_CMD $<TARGET_FILE:tracker_compiler>) + set(TRACKER_COMPILER_DEPENDS tracker_compiler) +endif() + +# Always build a host-native tracker_compiler for code generation purposes +add_executable(tracker_compiler_host tools/tracker_compiler.cc) +set_target_properties(tracker_compiler_host PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tools_host") + +# Determine which tracker compiler to use for code generation +if(DEMO_CROSS_COMPILE_WIN32) + set(TRACKER_COMPILER_FINAL_CMD "${CMAKE_SOURCE_DIR}/build_native/tools_host/tracker_compiler_host") + set(TRACKER_COMPILER_FINAL_DEPENDS tracker_compiler_host) +else() + set(TRACKER_COMPILER_FINAL_CMD ${TRACKER_COMPILER_CMD}) + set(TRACKER_COMPILER_FINAL_DEPENDS ${TRACKER_COMPILER_DEPENDS}) +endif() |
