[libxml2] fix build failure with x64-linux-dynamic (#14991)

This commit is contained in:
Kevin Lalumiere 2020-12-09 14:58:59 -05:00 committed by GitHub
parent c670d13a50
commit 1d8728ae1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -108,6 +108,19 @@ if(INSTALL_HEADERS)
set_target_properties(libxml2 PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") set_target_properties(libxml2 PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
endif() endif()
target_include_directories(libxml2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include include ${LIBLZMA_INCLUDE_DIRS}) target_include_directories(libxml2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include include ${LIBLZMA_INCLUDE_DIRS})
get_property(LIBRARIES TARGET Iconv::Iconv PROPERTY INTERFACE_LINK_LIBRARIES)
if(LIBRARIES)
set_property(TARGET Iconv::Iconv PROPERTY INTERFACE_LINK_LIBRARIES "")
foreach(LIBRARY ${LIBRARIES})
# Since `libc.so` has no SONAME, CMake maps e.g. `/usr/lib/x86_64-linux-gnu/libc.so` to `-llibc`.
# This is not found: it should be mapped to `-lc`.
if(LIBRARY MATCHES "/libc\\.so$")
set_property(TARGET Iconv::Iconv APPEND PROPERTY INTERFACE_LINK_LIBRARIES "c")
else()
set_property(TARGET Iconv::Iconv APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${LIBRARY}")
endif()
endforeach()
endif()
target_link_libraries(libxml2 PRIVATE target_link_libraries(libxml2 PRIVATE
Iconv::Iconv Iconv::Iconv
ZLIB::ZLIB ZLIB::ZLIB

View File

@ -1,6 +1,6 @@
Source: libxml2 Source: libxml2
Version: 2.9.10 Version: 2.9.10
Port-Version: 1 Port-Version: 2
Homepage: https://xmlsoft.org/ Homepage: https://xmlsoft.org/
Description: Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform) Description: Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform)
Build-Depends: zlib, libiconv, liblzma Build-Depends: zlib, libiconv, liblzma