Skip to content

Commit 7b62fd8

Browse files
committed
improve regex replace
1 parent 1cde56c commit 7b62fd8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

CMakeLists.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,8 @@ if(USE_PREBUILT_LLVM AND UNIX)
302302
# llvm_map_components_to_libnames(... all) returns empty string if llvm is
303303
# pre-built locally in either static or shared type in Ubuntu 22.04 container.
304304
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")
305+
string(REGEX REPLACE "( |\r|\n|-l)+" ";" ALL_LLVM_LIBS ${ALL_LIBS})
306+
set(ALL_LLVM_LIBS "LLVMSPIRVLib${ALL_LLVM_LIBS}")
308307
else()
309308
llvm_map_components_to_libnames(ALL_LLVM_LIBS all)
310309
endif()

0 commit comments

Comments
 (0)