Skip to content

Commit e5341eb

Browse files
authored
[SYCL-PTX] Fix libclc dependency path. (#2121)
Make sure libraries produced by libclc are systematically fully rebuild. Signed-off-by: Victor Lomuller <[email protected]>
1 parent 85839f8 commit e5341eb

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

libclc/cmake/modules/AddLibclc.cmake

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,29 @@ macro(add_libclc_builtin_set arch_suffix)
7474
set( obj_suffix ${arch_suffix}.bc )
7575

7676
# Add opt target
77-
add_custom_command( OUTPUT "${LIBCLC_LIBRARY_OUTPUT_INTDIR}/builtins.opt.${obj_suffix}"
77+
set( builtins_opt_path "${LIBCLC_LIBRARY_OUTPUT_INTDIR}/builtins.opt.${obj_suffix}" )
78+
add_custom_command( OUTPUT "${builtins_opt_path}"
7879
COMMAND ${LLVM_OPT} -O3 -o
79-
"${LIBCLC_LIBRARY_OUTPUT_INTDIR}/builtins.opt.${obj_suffix}"
80+
"${builtins_opt_path}"
8081
"${LIBCLC_LIBRARY_OUTPUT_INTDIR}/builtins.link.${obj_suffix}"
8182
DEPENDS opt "builtins.link.${arch_suffix}" )
8283
add_custom_target( "opt.${obj_suffix}" ALL
83-
DEPENDS "${LIBCLC_LIBRARY_OUTPUT_INTDIR}/builtins.opt.${obj_suffix}" )
84+
DEPENDS "${builtins_opt_path}" )
8485
set_target_properties("opt.${obj_suffix}"
85-
PROPERTIES TARGET_FILE "${LIBCLC_LIBRARY_OUTPUT_INTDIR}/builtins.opt.${obj_suffix}")
86+
PROPERTIES TARGET_FILE "${builtins_opt_path}")
8687

8788
# Add prepare target
88-
add_custom_command( OUTPUT "${LIBCLC_LIBRARY_OUTPUT_INTDIR}/${obj_suffix}"
89+
set( builtins_obj_path "${LIBCLC_LIBRARY_OUTPUT_INTDIR}/${obj_suffix}" )
90+
add_custom_command( OUTPUT "${builtins_obj_path}"
8991
COMMAND prepare_builtins -o
90-
"${LIBCLC_LIBRARY_OUTPUT_INTDIR}/${obj_suffix}"
92+
"${builtins_obj_path}"
9193
"$<TARGET_PROPERTY:opt.${obj_suffix},TARGET_FILE>"
92-
DEPENDS "opt.${obj_suffix}"
93-
prepare_builtins )
94+
DEPENDS ${builtins_opt_path}
95+
prepare_builtins )
9496
add_custom_target( "prepare-${obj_suffix}" ALL
95-
DEPENDS "${LIBCLC_LIBRARY_OUTPUT_INTDIR}/${obj_suffix}" )
97+
DEPENDS "${builtins_obj_path}" )
9698
set_target_properties("prepare-${obj_suffix}"
97-
PROPERTIES TARGET_FILE "${LIBCLC_LIBRARY_OUTPUT_INTDIR}/${obj_suffix}")
99+
PROPERTIES TARGET_FILE "${builtins_obj_path}")
98100

99101
# Add dependency to top-level pseudo target to ease making other
100102
# targets dependent on libclc.

0 commit comments

Comments
 (0)