forked from OSchip/llvm-project
Try to fix WindowsManifest CMake logic on Windows
CMake is complaining about the "^" regex if the prefixes are empty strings.
This commit is contained in:
parent
d334ce0b5a
commit
e441a584f3
|
@ -9,10 +9,12 @@ if(LIBXML2_LIBRARIES)
|
||||||
target_link_libraries(LLVMWindowsManifest PUBLIC ${LIBXML2_LIBRARIES})
|
target_link_libraries(LLVMWindowsManifest PUBLIC ${LIBXML2_LIBRARIES})
|
||||||
|
|
||||||
get_filename_component(xml2_library ${LIBXML2_LIBRARIES} NAME)
|
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_PREFIX}" "" xml2_library ${xml2_library})
|
||||||
string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" 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_PREFIX}" "" xml2_library ${xml2_library})
|
||||||
string(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "" xml2_library ${xml2_library})
|
string(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "" xml2_library ${xml2_library})
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue