diff options
| author | Kevin Lalumiere <klalumiere@coveo.com> | 2020-12-09 14:58:59 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-09 11:58:59 -0800 |
| commit | 1d8728ae1ba66ad94b344708cf8d0ace1a6330b8 (patch) | |
| tree | 23b8eb4c4b9cddeac81f4e77e696b812115abbf3 | |
| parent | c670d13a50c44cfd231bf12da69197c5985db9c2 (diff) | |
| download | vcpkg-1d8728ae1ba66ad94b344708cf8d0ace1a6330b8.tar.gz vcpkg-1d8728ae1ba66ad94b344708cf8d0ace1a6330b8.zip | |
[libxml2] fix build failure with x64-linux-dynamic (#14991)
| -rw-r--r-- | ports/libxml2/CMakeLists.txt | 13 | ||||
| -rw-r--r-- | ports/libxml2/CONTROL | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/ports/libxml2/CMakeLists.txt b/ports/libxml2/CMakeLists.txt index 323f64c34..bdc3939bf 100644 --- a/ports/libxml2/CMakeLists.txt +++ b/ports/libxml2/CMakeLists.txt @@ -108,6 +108,19 @@ if(INSTALL_HEADERS) set_target_properties(libxml2 PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") endif() 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 Iconv::Iconv ZLIB::ZLIB diff --git a/ports/libxml2/CONTROL b/ports/libxml2/CONTROL index 462ecfec6..fe8dec589 100644 --- a/ports/libxml2/CONTROL +++ b/ports/libxml2/CONTROL @@ -1,6 +1,6 @@ Source: libxml2 Version: 2.9.10 -Port-Version: 1 +Port-Version: 2 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) Build-Depends: zlib, libiconv, liblzma |
