[libxml2] Add link libraries for target LibXml2::LibXml2#14478
[libxml2] Add link libraries for target LibXml2::LibXml2#14478LilyWangL wants to merge 5 commits intomicrosoft:masterfrom
Conversation
Due to |
There was a problem hiding this comment.
Now it's broken on macOS.
This is my proposition:
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LIBXML2_LIBRARIES m)
else()
list(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES} ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES})
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
list(APPEND LIBXML2_LIBRARIES ws2_32)
endif()
endif()
if(TARGET LibXml2::LibXml2)
target_link_libraries(LibXml2::LibXml2 INTERFACE ${LIBXML2_LIBRARIES})
endif()
| if(CMAKE_SYSTEM_NAME STREQUAL "Windows") | ||
| list(APPEND LIBXML2_LIBRARIES ws2_32) | ||
| if(TARGET LibXml2::LibXml2) | ||
| target_link_libraries(LibXml2::LibXml2 INTERFACE ${LIBXML2_LIBRARIES}) |
There was a problem hiding this comment.
Simply no. This is linking itself. LIBXML2_LIBRARIES is not empty after the find_package call but contains the libxml2 library.
There was a problem hiding this comment.
Yeah, I think I agree with this; could we switch to the old code, but add target_link_libraries below the second list(APPEND?
|
Replaced by #14588. |
Describe the pull request
Target
LibXml2::LibXml2is not linked against all necessary libraries in vcpkg-cmake-wrapper.cmake. TargetLibXml2::LibXml2should link withIconv,Charset,lzma,zlib,ws2_32(windows only) libraries.