Add feature JSON_Diagnostics (#24672)

This commit is contained in:
Mengna Li 2022-05-14 07:52:17 +08:00 committed by GitHub
parent 81134652a6
commit 38910e67f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 6 deletions

View File

@ -10,9 +10,14 @@ if(NOT DEFINED nlohmann-json_IMPLICIT_CONVERSIONS)
set(nlohmann-json_IMPLICIT_CONVERSIONS ON)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"diagnostics" JSON_Diagnostics
)
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
-DJSON_Install=ON
-DJSON_MultipleHeaders=ON
-DJSON_BuildTests=OFF
@ -27,7 +32,7 @@ vcpkg_replace_string(
"{_IMPORT_PREFIX}/nlohmann_json.natvis"
"{_IMPORT_PREFIX}/share/nlohmann_json/nlohmann_json.natvis"
)
if(EXISTS ${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis)
if(EXISTS "${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis")
file(RENAME
"${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis"
"${CURRENT_PACKAGES_DIR}/share/nlohmann_json/nlohmann_json.natvis"

View File

@ -1,9 +1,10 @@
{
"name": "nlohmann-json",
"version-semver": "3.10.5",
"port-version": 2,
"port-version": 3,
"description": "JSON for Modern C++",
"homepage": "https://github.com/nlohmann/json",
"license": "MIT",
"dependencies": [
{
"name": "vcpkg-cmake",
@ -13,5 +14,10 @@
"name": "vcpkg-cmake-config",
"host": true
}
]
],
"features": {
"diagnostics": {
"description": "Build json_diagnostics"
}
}
}

View File

@ -4862,7 +4862,7 @@
},
"nlohmann-json": {
"baseline": "3.10.5",
"port-version": 2
"port-version": 3
},
"nlopt": {
"baseline": "2.7.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "91f188e19b106e7d316de593e98f3319f8f5ec25",
"version-semver": "3.10.5",
"port-version": 3
},
{
"git-tree": "becf6a86f7e28342840fc807840c68b133c6fad8",
"version-semver": "3.10.5",