-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libxml2] Add iconv and charset linkage in vcpkg-cmake-wrapper on osx #11072
Changes from all commits
d0fc192
611a905
4443f25
269acb3
a3b3ccb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Source: libxml2 | ||
Version: 2.9.9-5 | ||
Version: 2.9.9-6 | ||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,24 +2,25 @@ _find_package(${ARGS}) | |
if(LibXml2_FOUND) | ||
find_package(LibLZMA) | ||
find_package(ZLIB) | ||
|
||
include(SelectLibraryConfigurations) | ||
find_library(ICONV_LIBRARY_DEBUG NAMES iconvd libiconvd iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) | ||
find_library(ICONV_LIBRARY_RELEASE NAMES iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) | ||
find_library(ICONV_LIBRARY_RELEASE NAMES iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib) | ||
find_library(CHARSET_LIBRARY_DEBUG NAMES charsetd libcharsetd charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) | ||
find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) | ||
find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib) | ||
select_library_configurations(ICONV) | ||
select_library_configurations(CHARSET) | ||
list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES}) | ||
|
||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") | ||
list(APPEND LIBXML2_LIBRARIES | ||
debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libiconv.lib | ||
optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libiconv.lib | ||
debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libcharset.lib | ||
optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libcharset.lib | ||
ws2_32) | ||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
list(APPEND LIBXML2_LIBRARIES m) | ||
else() | ||
list(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least it looks like libxml is not linking against iconv on Linux or is linking against a shared version which does not require propagation. The correct fix would probably to make iconv build on all platforms and linking correctly against that. |
||
if(TARGET LibXml2::LibXml2) | ||
target_link_libraries(LibXml2::LibXml2 INTERFACE | ||
debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libiconv.lib | ||
optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libiconv.lib | ||
debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib/libcharset.lib | ||
optimized ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/libcharset.lib) | ||
target_link_libraries(LibXml2::LibXml2 INTERFACE ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES}) | ||
endif() | ||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
list(APPEND LIBXML2_LIBRARIES m) | ||
endif() | ||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") | ||
list(APPEND LIBXML2_LIBRARIES ws2_32) | ||
endif() | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this due to we might use system
iconv
or within vcpkg on different platforms?So we don't use
find_package(unofficial-iconv
to findiconv
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to avoid unofficial packages. The correct way would probably be to have pkg-config for iconv here but thats not yet integrated into vcpkg.