[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:
@@ -15,8 +15,8 @@ file(MAKE_DIRECTORY "${_test_dir}")
|
||||
message(STATUS "Check for working CLC compiler: ${CMAKE_CLC_COMPILER}")
|
||||
|
||||
execute_process(
|
||||
COMMAND "${CMAKE_CLC_COMPILER}" -x cl -c -flto
|
||||
-o "${_test_out}" "${_test_file}"
|
||||
COMMAND "${CMAKE_CLC_COMPILER}" --target=spirv64-unknown-unknown -x cl -c -flto
|
||||
-disable-llvm-passes -o "${_test_out}" "${_test_file}"
|
||||
RESULT_VARIABLE _clc_result
|
||||
ERROR_VARIABLE _clc_error
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user