Skip to content

Commit

Permalink
improve regex replace
Browse files Browse the repository at this point in the history
  • Loading branch information
wenju-he committed Oct 7, 2023
1 parent 1cde56c commit 7b62fd8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,8 @@ 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)
string(STRIP ${ALL_LIBS} ALL_LIBS_STRIP)
string(REGEX REPLACE "[ ]*-l" ";" ALL_LLVM_LIBS ${ALL_LIBS_STRIP})
set(ALL_LLVM_LIBS "${ALL_LLVM_LIBS};LLVMSPIRVLib")
string(REGEX REPLACE "( |\r|\n|-l)+" ";" ALL_LLVM_LIBS ${ALL_LIBS})
set(ALL_LLVM_LIBS "LLVMSPIRVLib${ALL_LLVM_LIBS}")
else()
llvm_map_components_to_libnames(ALL_LLVM_LIBS all)
endif()
Expand Down

0 comments on commit 7b62fd8

Please sign in to comment.