[llvm-branch-commits] [llvm] f5fd8a3 - Try to fix WindowsManifest CMake logic on Windows

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Mar 2 01:46:18 PST 2020


Author: Reid Kleckner
Date: 2020-03-02T10:45:14+01:00
New Revision: f5fd8a37c18439102eb30c85dadac68c260a1a0d

URL: https://github.com/llvm/llvm-project/commit/f5fd8a37c18439102eb30c85dadac68c260a1a0d
DIFF: https://github.com/llvm/llvm-project/commit/f5fd8a37c18439102eb30c85dadac68c260a1a0d.diff

LOG: Try to fix WindowsManifest CMake logic on Windows

CMake is complaining about the "^" regex if the prefixes are empty
strings.

(cherry picked from commit e441a584f3f7d743ab77031a47d9ad60ee56b53d)

Added: 
    

Modified: 
    llvm/lib/WindowsManifest/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/lib/WindowsManifest/CMakeLists.txt b/llvm/lib/WindowsManifest/CMakeLists.txt
index 8cfea1282ad6..7ccc17ad577d 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()


        


More information about the llvm-branch-commits mailing list