2
1

0004-FindXml2-use-pkg-config-to-find-libxml2-dependencies.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. From e6a2e71831f0699e9759e0579a00eea5fcb93696 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Wed, 24 Apr 2019 20:23:00 +0200
  4. Subject: [PATCH] FindXml2: use pkg-config to find libxml2 dependencies
  5. On UNIX, when statically built, libxml2 can depends on other libraries such
  6. as lzma. These dependencies are already retrieved through pkg-config so
  7. append them to LIBXML2_LIBRARIES otherwise static build will fail
  8. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  9. [Upstream status: not sent yet]
  10. ---
  11. cmake/modules/FindLibXml2.cmake | 4 ++++
  12. 1 file changed, 4 insertions(+)
  13. diff --git a/cmake/modules/FindLibXml2.cmake b/cmake/modules/FindLibXml2.cmake
  14. index 99d70af57d..2a4b1f470f 100644
  15. --- a/cmake/modules/FindLibXml2.cmake
  16. +++ b/cmake/modules/FindLibXml2.cmake
  17. @@ -98,6 +98,10 @@ endif()
  18. set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR} ${PC_LIBXML_INCLUDE_DIRS})
  19. set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
  20. +# Include transitive dependencies for static linking.
  21. +if(UNIX)
  22. + list(APPEND LIBXML2_LIBRARIES ${PC_LIBXML_LIBRARIES})
  23. +endif()
  24. include(FindPackageHandleStandardArgs)
  25. FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
  26. --
  27. 2.20.1