Skip to content

Commit dbc98cf

Browse files
authored
[libclc] [cmake] Fix per-target *_convert.cl dependencies (#127315)
Fix `add_libclc_builtin_set` to add an appropriate dependency to either `clspv-generate_convert.cl` or `generate_convert.cl` based on the `ARCH` argument, rather than to both unconditionally. This fixes build failures due to missing dependencies when `clspv*` targets are not enabled. The added check mirrors the one from `libclc/CMakeLists.txt`. Fixes: #127378
1 parent c6d95c4 commit dbc98cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libclc/cmake/modules/AddLibclc.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,19 @@ function(add_libclc_builtin_set)
249249

250250
get_filename_component( file_dir ${file} DIRECTORY )
251251

252+
if( ARG_ARCH STREQUAL spirv OR ARG_ARCH STREQUAL spirv64 )
253+
set(CONVERT_DEP clspv-generate_convert.cl)
254+
else()
255+
set(CONVERT_DEP generate_convert.cl)
256+
endif()
257+
252258
compile_to_bc(
253259
TRIPLE ${ARG_TRIPLE}
254260
INPUT ${input_file}
255261
OUTPUT ${output_file}
256262
EXTRA_OPTS -fno-builtin -nostdlib
257263
"${ARG_COMPILE_FLAGS}" -I${CMAKE_CURRENT_SOURCE_DIR}/${file_dir}
258-
DEPENDENCIES generate_convert.cl clspv-generate_convert.cl
264+
DEPENDENCIES ${CONVERT_DEP}
259265
)
260266
list( APPEND bytecode_files ${output_file} )
261267
endforeach()

0 commit comments

Comments
 (0)