[libclc] dbc98cf - [libclc] [cmake] Fix per-target *_convert.cl dependencies (#127315)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 15 23:48:56 PST 2025
Author: Michał Górny
Date: 2025-02-16T08:48:52+01:00
New Revision: dbc98cfa46d52ede06e8be7fc5e855d807ba0fac
URL: https://github.com/llvm/llvm-project/commit/dbc98cfa46d52ede06e8be7fc5e855d807ba0fac
DIFF: https://github.com/llvm/llvm-project/commit/dbc98cfa46d52ede06e8be7fc5e855d807ba0fac.diff
LOG: [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
Added:
Modified:
libclc/cmake/modules/AddLibclc.cmake
Removed:
################################################################################
diff --git a/libclc/cmake/modules/AddLibclc.cmake b/libclc/cmake/modules/AddLibclc.cmake
index b520626c6ffd1..a3b311f12a1e3 100644
--- a/libclc/cmake/modules/AddLibclc.cmake
+++ b/libclc/cmake/modules/AddLibclc.cmake
@@ -249,13 +249,19 @@ function(add_libclc_builtin_set)
get_filename_component( file_dir ${file} DIRECTORY )
+ if( ARG_ARCH STREQUAL spirv OR ARG_ARCH STREQUAL spirv64 )
+ set(CONVERT_DEP clspv-generate_convert.cl)
+ else()
+ set(CONVERT_DEP generate_convert.cl)
+ endif()
+
compile_to_bc(
TRIPLE ${ARG_TRIPLE}
INPUT ${input_file}
OUTPUT ${output_file}
EXTRA_OPTS -fno-builtin -nostdlib
"${ARG_COMPILE_FLAGS}" -I${CMAKE_CURRENT_SOURCE_DIR}/${file_dir}
- DEPENDENCIES generate_convert.cl clspv-generate_convert.cl
+ DEPENDENCIES ${CONVERT_DEP}
)
list( APPEND bytecode_files ${output_file} )
endforeach()
More information about the cfe-commits
mailing list