diff options
Diffstat (limited to 'cmake/DemoCodegen.cmake')
| -rw-r--r-- | cmake/DemoCodegen.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/DemoCodegen.cmake b/cmake/DemoCodegen.cmake index aaf54a3..a353fc7 100644 --- a/cmake/DemoCodegen.cmake +++ b/cmake/DemoCodegen.cmake @@ -244,6 +244,14 @@ if(NOT DEMO_STRIP_ALL) set(ASSET_PACKER_FLAGS "--disk_load") endif() +# Write a flag file so that toggling DEMO_STRIP_ALL triggers asset regeneration. +set(ASSET_MODE_FLAG_FILE "${CMAKE_CURRENT_BINARY_DIR}/asset_packer_mode.flag") +if(DEMO_STRIP_ALL) + file(WRITE "${ASSET_MODE_FLAG_FILE}" "strip_all\n") +else() + file(WRITE "${ASSET_MODE_FLAG_FILE}" "disk_load\n") +endif() + set(GEN_DEMO_H_STAMP ${GEN_DEMO_H}.gen_stamp) add_custom_command( OUTPUT ${GEN_DEMO_H_STAMP} ${GEN_DEMO_CC} @@ -252,6 +260,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${GEN_DEMO_H}.new ${GEN_DEMO_H} COMMAND ${CMAKE_COMMAND} -E touch ${GEN_DEMO_H_STAMP} DEPENDS ${ASSET_PACKER_DEPENDS} ${WORKSPACE_ASSETS} + ${ASSET_MODE_FLAG_FILE} ${GEN_DEMO_H}.shaders_stamp ${GEN_DEMO_H}.audio_stamp ${GEN_DEMO_H}.models_stamp |
