Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use find_program to find llvm-config #498

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,14 @@ endif()
if(USE_PREBUILT_LLVM AND UNIX)
# llvm_map_components_to_libnames(... all) returns empty string if llvm is
# pre-built locally in either static or shared type in Ubuntu 22.04 container.
execute_process(COMMAND llvm-config --libs all OUTPUT_VARIABLE ALL_LIBS)
find_program(LLVM_CONFIG_EXE
NAMES llvm-config-${PREFERRED_LLVM_VERSION} llvm-config
PATHS ${LLVM_BINARY_DIR} ${LLVM_BINARY_DIR}/bin)
if(NOT LLVM_CONFIG_EXE)
message(FATAL_ERROR "[OPENCL-CLANG] llvm-config is not found")
endif()

execute_process(COMMAND ${LLVM_CONFIG_EXE} --libs all OUTPUT_VARIABLE ALL_LIBS)
string(REGEX REPLACE "( |\r|\n|-l)+" ";" ALL_LLVM_LIBS ${ALL_LIBS})
set(ALL_LLVM_LIBS "LLVMSPIRVLib${ALL_LLVM_LIBS}")
else()
Expand Down