[libclc] fix compiler check with --target=spirv64 and -disable-llvm-passes (#185376)

Fix "unknown target triple" errors when LLVM_TARGETS_TO_BUILD is empty.

Adding -disable-llvm-passes reduces this to a very basic sanity check
of Clang frontend. This allows the test to pass even if SPIR-V backend
is not enabled, as the frontend can still generate IR for the target.
This commit is contained in:
Wenju He
2026-03-17 07:59:14 +08:00
committed by GitHub
parent 6527a3a23e
commit 1c04e7fada

View File

@@ -15,8 +15,8 @@ file(MAKE_DIRECTORY "${_test_dir}")
message(STATUS "Check for working CLC compiler: ${CMAKE_CLC_COMPILER}") message(STATUS "Check for working CLC compiler: ${CMAKE_CLC_COMPILER}")
execute_process( execute_process(
COMMAND "${CMAKE_CLC_COMPILER}" -x cl -c -flto COMMAND "${CMAKE_CLC_COMPILER}" --target=spirv64-unknown-unknown -x cl -c -flto
-o "${_test_out}" "${_test_file}" -disable-llvm-passes -o "${_test_out}" "${_test_file}"
RESULT_VARIABLE _clc_result RESULT_VARIABLE _clc_result
ERROR_VARIABLE _clc_error ERROR_VARIABLE _clc_error
) )