[PATCH] D84563: [CMake] Simplify CMake handling for libxml2
Saleem Abdulrasool via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 28 09:15:03 PDT 2020
compnerd accepted this revision.
compnerd added a comment.
This revision is now accepted and ready to land.
Thank you for renaming the variable while at it - it's far more conventional.
================
Comment at: llvm/lib/WindowsManifest/CMakeLists.txt:11
+ ${Backtrace_INCLUDE_DIRS}
+ LINK_LIBS ${imported_libs})
----------------
Can you not get away with
```
if(LLVM_ENABLE_LIBXML2)
target_link_libraries(LLVMWindowsManifest PRIVATE LibXml2::LibXml2)
endif()
```
instead?
================
Comment at: llvm/lib/WindowsManifest/CMakeLists.txt:13
- get_filename_component(xml2_library ${LIBXML2_LIBRARIES} NAME)
- 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 (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})
+if(LLVM_ENABLE_LIBXML2)
+ string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
----------------
A nice little comment to remind the reader that this is for `llvm-config` would be appreciated.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84563/new/
https://reviews.llvm.org/D84563
More information about the llvm-commits
mailing list