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) set(nlohmann-json_IMPLICIT_CONVERSIONS ON)
endif() endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"diagnostics" JSON_Diagnostics
)
vcpkg_cmake_configure( vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH} SOURCE_PATH "${SOURCE_PATH}"
OPTIONS OPTIONS ${FEATURE_OPTIONS}
-DJSON_Install=ON -DJSON_Install=ON
-DJSON_MultipleHeaders=ON -DJSON_MultipleHeaders=ON
-DJSON_BuildTests=OFF -DJSON_BuildTests=OFF
@ -27,7 +32,7 @@ vcpkg_replace_string(
"{_IMPORT_PREFIX}/nlohmann_json.natvis" "{_IMPORT_PREFIX}/nlohmann_json.natvis"
"{_IMPORT_PREFIX}/share/nlohmann_json/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 file(RENAME
"${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis" "${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis"
"${CURRENT_PACKAGES_DIR}/share/nlohmann_json/nlohmann_json.natvis" "${CURRENT_PACKAGES_DIR}/share/nlohmann_json/nlohmann_json.natvis"

View File

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

View File

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

View File

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