From fcd4b8d2e4da8d70793a716027baa9e916907fb0 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Wed, 26 Aug 2026 11:14:34 +1000 Subject: [PATCH] fix(cpn): declare simulator target before referencing it in wasm-copy step (#7708) Co-authored-by: Peter Feerick <5500713+pfeerick@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 --- companion/src/CMakeLists.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index a53b10811..ef5ad0c88 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -272,19 +272,6 @@ target_link_libraries(${COMPANION_NAME} PRIVATE PrintTargetReport("${COMPANION_NAME}") -# Copy WASM simulator modules next to executables for local dev -if(SIMULATOR_WASM_DIR) - foreach(_target ${COMPANION_NAME} ${SIMULATOR_NAME}) - add_custom_command(TARGET ${_target} POST_BUILD - COMMAND ${CMAKE_COMMAND} - -DSRC_DIR=${SIMULATOR_WASM_DIR} - -DDST_DIR=$ - -P ${CMAKE_SOURCE_DIR}/cmake/CopyWasmModules.cmake - COMMENT "Copying WASM simulator modules to ${_target} output" - ) - endforeach() -endif() - ############# Standalone simulator ############### set(simu_SRCS simulator.cpp ) @@ -299,6 +286,19 @@ target_link_libraries(${SIMULATOR_NAME} PRIVATE ${SDL2_LIBRARIES} ) +# Copy WASM simulator modules next to executables for local dev +if(SIMULATOR_WASM_DIR) + foreach(_target ${COMPANION_NAME} ${SIMULATOR_NAME}) + add_custom_command(TARGET ${_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} + -DSRC_DIR=${SIMULATOR_WASM_DIR} + -DDST_DIR=$ + -P ${CMAKE_SOURCE_DIR}/cmake/CopyWasmModules.cmake + COMMENT "Copying WASM simulator modules to ${_target} output" + ) + endforeach() +endif() + add_subdirectory(tests) ############# Install ####################