[PATCH] D86245: Fix an issue where get_system_libname creates an empty regex capture on windows
Harmen Stoppels via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 19 13:39:41 PDT 2020
haampie created this revision.
haampie added reviewers: phosek, aeubanks, JDevlieghere.
Herald added subscribers: llvm-commits, hiraditya, mgorny.
Herald added a project: LLVM.
haampie requested review of this revision.
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1119478
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D86245
Files:
llvm/lib/Support/CMakeLists.txt
Index: llvm/lib/Support/CMakeLists.txt
===================================================================
--- llvm/lib/Support/CMakeLists.txt
+++ llvm/lib/Support/CMakeLists.txt
@@ -4,10 +4,14 @@
function(get_system_libname libpath libname)
get_filename_component(libpath ${libpath} NAME)
- string(REPLACE ";" "|" PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
- string(REPLACE ";" "|" SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")
- STRING(REGEX REPLACE "^(${PREFIXES})" "" libpath ${libpath})
- STRING(REGEX REPLACE "(${SUFFIXES})$" "" libpath ${libpath})
+ if( CMAKE_FIND_LIBRARY_PREFIXES )
+ string(REPLACE ";" "|" PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
+ string(REGEX REPLACE "^(${PREFIXES})" "" libpath ${libpath})
+ endif()
+ if( CMAKE_FIND_LIBRARY_SUFFIXES )
+ string(REPLACE ";" "|" SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")
+ string(REGEX REPLACE "(${SUFFIXES})$" "" libpath ${libpath})
+ endif()
set(${libname} "${libpath}" PARENT_SCOPE)
endfunction()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86245.286652.patch
Type: text/x-patch
Size: 994 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200819/920db92f/attachment.bin>
More information about the llvm-commits
mailing list