[libxml2] Improve pc file (#17747)

* Use rcVersion.h.in from PORT_DIR directly

* Inject static linking deps into pc file

* x-add-version

* Insert requires pc modules directly

* x-add-version
This commit is contained in:
Kai Pastor 2021-05-19 08:03:54 +02:00 committed by GitHub
parent 5e7278a224
commit 5554e3f268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 4 deletions

View File

@ -138,7 +138,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsSt
_WINSOCK_DEPRECATED_NO_WARNINGS
)
target_sources(libxml2 PRIVATE win32/libxml2.rc)
configure_file(rcVersion.h.in include/rcVersion.h @ONLY)
configure_file("${PORT_DIR}/rcVersion.h.in" include/rcVersion.h @ONLY)
endif()
target_compile_definitions(libxml2 PRIVATE
@ -166,6 +166,13 @@ install(TARGETS libxml2
)
# pkgconfig
if(NOT Iconv_IS_BUILT_IN)
set(ICONV_LIBS "-liconv")
endif()
if(UNIX)
set(M_LIBS "-lm")
set(THREAD_LIBS "-pthread")
endif()
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir ${prefix}/${CMAKE_INSTALL_LIBDIR})

View File

@ -7,7 +7,6 @@ vcpkg_from_github(
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/rcVersion.h.in DESTINATION ${SOURCE_PATH})
if (VCPKG_TARGET_IS_UWP)
message(WARNING "Feature network couldn't be enabled on UWP, disable http and ftp automatically.")
@ -35,6 +34,10 @@ if(VCPKG_TARGET_IS_WINDOWS)
endif()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libxml-2.0.pc" "-lxml2" "-llibxml2")
endif ()
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libxml-2.0.pc" "\nRequires:\n" "\nRequires.private: liblzma zlib\n")
endif()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libxml-2.0.pc" "\nRequires:\n" "\nRequires.private: liblzma zlib\n")
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

View File

@ -1,7 +1,7 @@
{
"name": "libxml2",
"version-semver": "2.9.10",
"port-version": 6,
"port-version": 7,
"description": "Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform).",
"homepage": "https://xmlsoft.org/",
"dependencies": [

View File

@ -3666,7 +3666,7 @@
},
"libxml2": {
"baseline": "2.9.10",
"port-version": 6
"port-version": 7
},
"libxmlmm": {
"baseline": "0.6.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f86ba7081b940af77e935875fbdf9cbf69446b9f",
"version-semver": "2.9.10",
"port-version": 7
},
{
"git-tree": "306378bea94b3a4b3c5992510b992b3690b87f52",
"version-semver": "2.9.10",