[jansson] Fix UWP build (#24466)

* [jansson] cleanup

* version

* Roll back version

* version

* Unsupported on UWP

* version

* patch

* Remove supports

* version
This commit is contained in:
Thomas1664 2022-04-29 05:50:41 +02:00 committed by GitHub
parent 6e52f3130d
commit 585ff442dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 25 deletions

View File

@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 39b9ad3..ed33e3c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -342,7 +342,7 @@ if(JANSSON_BUILD_SHARED_LIBS)
)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/jansson.sym")
if (VSCRIPT_WORKS)
- set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/jansson.sym")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/jansson.sym")
endif()
endif()

View File

@ -4,47 +4,37 @@ vcpkg_from_github(
REF 684e18c927e89615c2d501737e90018f4930d6c5 # v2.14
SHA512 e2cac3567bc860d10d9aa386ce370876cb21ff083a970abeb48112b6586b91cd101694a98cb05a06795fb04498e6bc2df3615fedb86635f5a998b68e5670e5b3
HEAD_REF master
PATCHES
fix-linker-flags.patch
)
if(VCPKG_CRT_LINKAGE STREQUAL static)
set(JANSSON_STATIC_CRT ON)
else()
set(JANSSON_STATIC_CRT OFF)
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(JANSSON_BUILD_SHARED_LIBS ON)
else()
set(JANSSON_BUILD_SHARED_LIBS OFF)
endif()
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" JANSSON_STATIC_CRT)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" JANSSON_BUILD_SHARED_LIBS)
# Jansson tries to random-seed its hash table with system-provided entropy.
# This is not ported to UWP yet.
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(VCPKG_TARGET_IS_UWP)
set(USE_WINDOWS_CRYPTOAPI OFF)
else()
set(USE_WINDOWS_CRYPTOAPI ON)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DJANSSON_STATIC_CRT=${JANSSON_STATIC_CRT}
-DJANSSON_EXAMPLES=OFF
-DJANSSON_WITHOUT_TESTS=ON
-DJANSSON_BUILD_DOCS=OFF
-DJANSSON_BUILD_SHARED_LIBS=${JANSSON_BUILD_SHARED_LIBS}
-DUSE_WINDOWS_CRYPTOAPI=${USE_WINDOWS_CRYPTOAPI}
-DJANSSON_INSTALL_CMAKE_DIR:STRING=share/jansson
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,6 +1,18 @@
{
"name": "jansson",
"version": "2.14",
"port-version": 1,
"description": "Jansson is a C library for encoding, decoding and manipulating JSON data",
"homepage": "https://github.com/akheron/jansson"
"homepage": "https://github.com/akheron/jansson",
"license": "MIT",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -3018,7 +3018,7 @@
},
"jansson": {
"baseline": "2.14",
"port-version": 0
"port-version": 1
},
"jasper": {
"baseline": "2.0.33",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "f284c9aba6b994cb6fe175b675976d34257b4c85",
"version": "2.14",
"port-version": 1
},
{
"git-tree": "1a5c55feab368e4bfb40be993b9ea5a39fc82f51",
"version": "2.14",