[libclc] 3d118f9 - [libclc] Fix dependencies between targets
Fraser Cormack via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 16 07:20:48 PDT 2024
Author: Fraser Cormack
Date: 2024-04-16T15:20:26+01:00
New Revision: 3d118f92081ea0c7048749dc5d08c8e8217be4eb
URL: https://github.com/llvm/llvm-project/commit/3d118f92081ea0c7048749dc5d08c8e8217be4eb
DIFF: https://github.com/llvm/llvm-project/commit/3d118f92081ea0c7048749dc5d08c8e8217be4eb.diff
LOG: [libclc] Fix dependencies between targets
We need file-level - not target-level - dependencies for these custom
commands to re-trigger when their dependencies change.
Added:
Modified:
libclc/CMakeLists.txt
Removed:
################################################################################
diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 302f559dba7a04..ed2764847e709e 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -364,7 +364,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
set( spv_suffix ${arch_suffix}.spv )
add_custom_command( OUTPUT ${spv_suffix}
COMMAND ${LLVM_SPIRV} ${spvflags} -o ${spv_suffix} ${builtins_link_lib}
- DEPENDS ${builtins_link_lib_tgt}
+ DEPENDS ${builtins_link_lib}
)
add_custom_target( "prepare-${spv_suffix}" ALL DEPENDS "${spv_suffix}" )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${spv_suffix}
@@ -376,7 +376,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
add_custom_command( OUTPUT ${builtins_opt_lib_tgt}.bc
COMMAND libclc::opt ${opt_flags} -o ${builtins_opt_lib_tgt}.bc
${builtins_link_lib}
- DEPENDS libclc::opt ${builtins_link_lib_tgt}
+ DEPENDS libclc::opt ${builtins_link_lib}
)
add_custom_target( ${builtins_opt_lib_tgt}
ALL DEPENDS ${builtins_opt_lib_tgt}.bc
@@ -385,12 +385,13 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
PROPERTIES TARGET_FILE ${builtins_opt_lib_tgt}.bc
)
+ set( builtins_opt_lib $<TARGET_PROPERTY:${builtins_opt_lib_tgt},TARGET_FILE> )
+
# Add prepare target
set( obj_suffix ${arch_suffix}.bc )
add_custom_command( OUTPUT ${obj_suffix}
- COMMAND prepare_builtins -o ${obj_suffix}
- $<TARGET_PROPERTY:${builtins_opt_lib_tgt},TARGET_FILE>
- DEPENDS ${builtins_opt_lib_tgt} prepare_builtins )
+ COMMAND prepare_builtins -o ${obj_suffix} ${builtins_opt_lib}
+ DEPENDS ${builtins_opt_lib} prepare_builtins )
add_custom_target( prepare-${obj_suffix} ALL DEPENDS ${obj_suffix} )
# nvptx-- targets don't include workitem builtins
More information about the cfe-commits
mailing list