From 95dd0ff4c000f3752c5c9112d79de3a4bdaa7b25 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 17 Feb 2026 11:32:05 +0100 Subject: fix(build): Resolve clean build failure from generated timeline header When starting from a clean tree (where `src/generated/` does not exist), the build would fail with a "file not found" error for `generated/timeline.h`. This was due to an incorrect dependency graph where `gpu.cc` was compiled before its required header was generated. This commit fixes the issue by making the dependency explicit: - Modified `tools/seq_compiler.py` to explicitly generate `timeline.h` alongside `timeline.cc`. - Updated `cmake/DemoCodegen.cmake` to declare both files as `OUTPUT`s of the timeline compilation step. - Added a direct dependency from the `gpu` library target to the `generate_timeline` custom target in `cmake/DemoLibraries.cmake`. - Refactored the generated file paths in `DemoCodegen.cmake` into a single `GENERATED_CODE` variable for improved clarity and future-proofing. --- cmake/DemoCodegen.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cmake/DemoCodegen.cmake') diff --git a/cmake/DemoCodegen.cmake b/cmake/DemoCodegen.cmake index 1e0badf..aa20a92 100644 --- a/cmake/DemoCodegen.cmake +++ b/cmake/DemoCodegen.cmake @@ -122,15 +122,17 @@ endfunction() # Timeline compilation set(DEMO_SEQ_PATH ${WORKSPACE_TIMELINE}) set(GENERATED_TIMELINE_CC ${CMAKE_CURRENT_SOURCE_DIR}/src/generated/timeline.cc) +set(GENERATED_TIMELINE_H ${CMAKE_CURRENT_SOURCE_DIR}/src/generated/timeline.h) +set(GENERATED_CODE ${GENERATED_TIMELINE_CC} ${GENERATED_TIMELINE_H}) add_custom_command( - OUTPUT ${GENERATED_TIMELINE_CC} + OUTPUT ${GENERATED_CODE} COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_SOURCE_DIR}/src/generated COMMAND ${SEQ_COMPILER_CMD} ${DEMO_SEQ_PATH} --output ${GENERATED_TIMELINE_CC} DEPENDS ${SEQ_COMPILER_DEPENDS} ${DEMO_SEQ_PATH} src/gpu/demo_effects.h COMMENT "Compiling demo sequence from workspace ${DEMO_WORKSPACE}..." ) -add_custom_target(generate_timeline ALL DEPENDS ${GENERATED_TIMELINE_CC}) +add_custom_target(generate_timeline ALL DEPENDS ${GENERATED_CODE}) # Music compilation set(TRACKER_MUSIC_PATH ${WORKSPACE_MUSIC}) @@ -255,5 +257,5 @@ pack_test_assets(test_assets ${CMAKE_CURRENT_SOURCE_DIR}/workspaces/test/assets. # Mark generated files so CMake always checks if they need rebuilding set_source_files_properties(${GEN_DEMO_H} ${GEN_DEMO_CC} PROPERTIES GENERATED TRUE) set_source_files_properties(${GEN_TEST_H} ${GEN_TEST_CC} PROPERTIES GENERATED TRUE) -set_source_files_properties(${GENERATED_TIMELINE_CC} PROPERTIES GENERATED TRUE) +set_source_files_properties(${GENERATED_CODE} PROPERTIES GENERATED TRUE) set_source_files_properties(${GENERATED_MUSIC_DATA_CC} PROPERTIES GENERATED TRUE) -- cgit v1.2.3