Skip to content

Commit

Permalink
Fix dependency tracking for object files.
Browse files Browse the repository at this point in the history
Using $<TARGET_FILE> automatically adds a target-level dependency, but
not a file-level dependency. Only the latter can trigger a rebuild on
change.

Fixes #182
  • Loading branch information
mysterymath committed Sep 7, 2023
1 parent 1090959 commit e165e08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function(add_platform_object_file target output)

add_custom_command(OUTPUT ${output}
COMMAND ${LLVM_MOS_LINKER} -r -o ${output} --whole-archive
$<TARGET_FILE:${target}>)
$<TARGET_FILE:${target}> DEPENDS ${target})
add_custom_target(${target}-o ALL DEPENDS ${output})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${output} TYPE LIB)

Expand Down

0 comments on commit e165e08

Please sign in to comment.