File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -298,8 +298,17 @@ else()
298298 )
299299endif ()
300300
301+ if (USE_PREBUILT_LLVM AND UNIX )
302+ # llvm_map_components_to_libnames(... all) returns empty string if llvm is
303+ # pre-built locally in either static or shared type in Ubuntu 22.04 container.
304+ execute_process (COMMAND llvm-config --libs all OUTPUT_VARIABLE ALL_LIBS)
305+ string (STRIP ${ALL_LIBS} ALL_LIBS_STRIP)
306+ string (REGEX REPLACE "[ ]*-l" ";" ALL_LLVM_LIBS ${ALL_LIBS_STRIP} )
307+ set (ALL_LLVM_LIBS "${ALL_LLVM_LIBS} ;LLVMSPIRVLib" )
308+ else ()
309+ llvm_map_components_to_libnames(ALL_LLVM_LIBS all )
310+ endif ()
301311set (OPENCL_CLANG_EXCLUDE_LIBS_FROM_ALL "" CACHE STRING "Space-separated list of LLVM libraries to exclude from all" )
302- llvm_map_components_to_libnames(ALL_LLVM_LIBS all )
303312if (NOT "${OPENCL_CLANG_EXCLUDE_LIBS_FROM_ALL} " STREQUAL "" )
304313 list (REMOVE_ITEM ALL_LLVM_LIBS ${OPENCL_CLANG_EXCLUDE_LIBS_FROM_ALL} )
305314endif ()
You can’t perform that action at this time.
0 commit comments