[libclc] Fix llvm-spirv dependency when llvm-spirv is built in-tree (#188896)

When SPIRV-LLVM-Translator is built in-tree (i.e., placed in
llvm/projects folder), llvm-spirv target exists.

Drop legacy llvm-spirv_target dependency (was for non-runtime build) and
add llvm-spirv to runtimes dependencies.
This commit is contained in:
Wenju He 2026-03-28 07:06:23 +08:00 committed by GitHub
parent 89ae675f59
commit 7be9972cb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 3 deletions

View File

@ -94,7 +94,6 @@ if( NOT LIBCLC_USE_SPIRV_BACKEND )
else()
find_program( LLVM_SPIRV llvm-spirv HINTS ${LLVM_TOOLS_BINARY_DIR} )
set( llvm-spirv_exe "${LLVM_SPIRV}" )
set( llvm-spirv_target )
endif()
endif()

View File

@ -127,7 +127,7 @@ function(link_libclc_builtin_library target_name)
--spirv-max-version=1.1
--spirv-ext=+SPV_KHR_fma
-o ${builtins_lib} ${linked_bc}
DEPENDS ${llvm-spirv_target} ${linked_bc}
DEPENDS ${linked_bc}
)
endif()
else()

View File

@ -554,7 +554,7 @@ if(build_runtimes)
# TODO: We need to consider passing it as '-DRUNTIMES_x86_64_LLVM_ENABLE_RUNTIMES'.
if("libclc" IN_LIST LLVM_ENABLE_RUNTIMES)
foreach(dep clang llvm-link opt llvm-ar llvm-ranlib)
foreach(dep clang llvm-link opt llvm-ar llvm-ranlib llvm-spirv)
if(TARGET ${dep})
list(APPEND extra_deps ${dep})
endif()