aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2020-02-28 17:21:50 -0800
committerReid Kleckner <rnk@google.com>2020-02-28 17:24:03 -0800
commite441a584f3f7d743ab77031a47d9ad60ee56b53d (patch)
treeb259375bc36e7e2b33251dfc25f65939bde66277
parentd334ce0b5acb945d6202d0ab6a17bdca530f50c1 (diff)
downloadllvm-e441a584f3f7d743ab77031a47d9ad60ee56b53d.zip
llvm-e441a584f3f7d743ab77031a47d9ad60ee56b53d.tar.gz
llvm-e441a584f3f7d743ab77031a47d9ad60ee56b53d.tar.bz2
Try to fix WindowsManifest CMake logic on Windows
CMake is complaining about the "^" regex if the prefixes are empty strings.
-rw-r--r--llvm/lib/WindowsManifest/CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/WindowsManifest/CMakeLists.txt b/llvm/lib/WindowsManifest/CMakeLists.txt
index 8cfea12..7ccc17a 100644
--- a/llvm/lib/WindowsManifest/CMakeLists.txt
+++ b/llvm/lib/WindowsManifest/CMakeLists.txt
@@ -9,10 +9,12 @@ if(LIBXML2_LIBRARIES)
target_link_libraries(LLVMWindowsManifest PUBLIC ${LIBXML2_LIBRARIES})
get_filename_component(xml2_library ${LIBXML2_LIBRARIES} NAME)
- if(xml2_library MATCHES "^${CMAKE_STATIC_LIBRARY_PREFIX}.*${CMAKE_STATIC_LIBRARY_SUFFIX}$")
+ if (CMAKE_STATIC_LIBRARY_PREFIX AND
+ xml2_library MATCHES "^${CMAKE_STATIC_LIBRARY_PREFIX}.*${CMAKE_STATIC_LIBRARY_SUFFIX}$")
string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" xml2_library ${xml2_library})
string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" xml2_library ${xml2_library})
- elseif(xml2_library MATCHES "^${CMAKE_SHARED_LIBRARY_PREFIX}.*${CMAKE_SHARED_LIBRARY_SUFFIX}$")
+ elseif (CMAKE_SHARED_LIBRARY_PREFIX AND
+ xml2_library MATCHES "^${CMAKE_SHARED_LIBRARY_PREFIX}.*${CMAKE_SHARED_LIBRARY_SUFFIX}$")
string(REGEX REPLACE "^${CMAKE_SHARED_LIBRARY_PREFIX}" "" xml2_library ${xml2_library})
string(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "" xml2_library ${xml2_library})
endif()