Skip to content

Commit

Permalink
[libxml2] Fix build error on uwp (#19221)
Browse files Browse the repository at this point in the history
* [libxml2] Fix build error on uwp

* Update versions
  • Loading branch information
NancyLi1013 authored Aug 2, 2021
1 parent 2f57397 commit fb24bdc
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
12 changes: 12 additions & 0 deletions ports/libxml2/fix-uwp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9b45d62..ba8bfec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,6 +129,7 @@ endif()

if(MSVC)
configure_file(include/win32config.h config.h COPYONLY)
+ add_compile_options(/wd4996)
else()
check_c_source_compiles("
void __attribute__((destructor))
10 changes: 5 additions & 5 deletions ports/libxml2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ vcpkg_from_gitlab(
HEAD_REF master
PATCHES
fix_cmakelist.patch
fix-uwp.patch
)

if (VCPKG_TARGET_IS_UWP)
Expand All @@ -18,11 +19,10 @@ endif()

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"tools" LIBXML2_WITH_PROGRAMS
"tools" LIBXML2_WITH_PROGRAMS
)
vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
${FEATURE_OPTIONS}
-DLIBXML2_WITH_TESTS=OFF
Expand Down Expand Up @@ -61,9 +61,9 @@ vcpkg_configure_cmake(
-DLIBXML2_WITH_XPTR=ON
)

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libxml2)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libxml2)
vcpkg_fixup_pkgconfig()

vcpkg_copy_pdbs()
Expand Down
11 changes: 9 additions & 2 deletions ports/libxml2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
{
"name": "libxml2",
"version-semver": "2.9.12",
"port-version": 1,
"port-version": 2,
"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/",
"supports": "!uwp",
"dependencies": [
"libiconv",
"liblzma",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
],
"features": {
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3754,7 +3754,7 @@
},
"libxml2": {
"baseline": "2.9.12",
"port-version": 1
"port-version": 2
},
"libxmlmm": {
"baseline": "0.6.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libxml2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f86cd2ab2c75dcd8e97ee18191b343f0b31bfb7c",
"version-semver": "2.9.12",
"port-version": 2
},
{
"git-tree": "a68bece41619060ca2e212b916dcc60c65ca3603",
"version-semver": "2.9.12",
Expand Down

0 comments on commit fb24bdc

Please sign in to comment.