Skip to content

Commit e441a58

Browse files
committed
Try to fix WindowsManifest CMake logic on Windows
CMake is complaining about the "^" regex if the prefixes are empty strings.
1 parent d334ce0 commit e441a58

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/lib/WindowsManifest/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ if(LIBXML2_LIBRARIES)
99
target_link_libraries(LLVMWindowsManifest PUBLIC ${LIBXML2_LIBRARIES})
1010

1111
get_filename_component(xml2_library ${LIBXML2_LIBRARIES} NAME)
12-
if(xml2_library MATCHES "^${CMAKE_STATIC_LIBRARY_PREFIX}.*${CMAKE_STATIC_LIBRARY_SUFFIX}$")
12+
if (CMAKE_STATIC_LIBRARY_PREFIX AND
13+
xml2_library MATCHES "^${CMAKE_STATIC_LIBRARY_PREFIX}.*${CMAKE_STATIC_LIBRARY_SUFFIX}$")
1314
string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" xml2_library ${xml2_library})
1415
string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" xml2_library ${xml2_library})
15-
elseif(xml2_library MATCHES "^${CMAKE_SHARED_LIBRARY_PREFIX}.*${CMAKE_SHARED_LIBRARY_SUFFIX}$")
16+
elseif (CMAKE_SHARED_LIBRARY_PREFIX AND
17+
xml2_library MATCHES "^${CMAKE_SHARED_LIBRARY_PREFIX}.*${CMAKE_SHARED_LIBRARY_SUFFIX}$")
1618
string(REGEX REPLACE "^${CMAKE_SHARED_LIBRARY_PREFIX}" "" xml2_library ${xml2_library})
1719
string(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "" xml2_library ${xml2_library})
1820
endif()

0 commit comments

Comments
 (0)