This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Simplify CMake handling for libxml2
ClosedPublic

Authored by phosek on Jul 24 2020, 3:52 PM.

Details

Summary

This matches the changes made to handling of zlib done in 10b1b4a
where we rely on find_package and the imported target rather than
manually appending the library and include paths. The use of
LLVM_LIBXML2_ENABLED has been replaced by LLVM_ENABLE_LIBXML2
thus reducing the number of variables.

Diff Detail

Event Timeline

phosek created this revision.Jul 24 2020, 3:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2020, 3:52 PM
phosek updated this revision to Diff 280610.Jul 24 2020, 3:53 PM
phosek updated this revision to Diff 281086.Jul 27 2020, 5:17 PM
compnerd accepted this revision.Jul 28 2020, 9:15 AM

Thank you for renaming the variable while at it - it's far more conventional.

llvm/lib/WindowsManifest/CMakeLists.txt
15

Can you not get away with

if(LLVM_ENABLE_LIBXML2)
  target_link_libraries(LLVMWindowsManifest PRIVATE LibXml2::LibXml2)
endif()

instead?

15–24

A nice little comment to remind the reader that this is for llvm-config would be appreciated.

This revision is now accepted and ready to land.Jul 28 2020, 9:15 AM
phosek updated this revision to Diff 290854.Sep 9 2020, 5:59 PM
phosek marked 2 inline comments as done.
phosek updated this revision to Diff 290868.Sep 9 2020, 9:43 PM
This revision was automatically updated to reflect the committed changes.