forked from vector-of-bool/pmm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use nlohmann-json for the overlay test, to not collide with spdlog
- Loading branch information
1 parent
f9fa2ae
commit 806aec6
Showing
6 changed files
with
74 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
tests/ci/vcpkg-overlay/custom-ports2/nlohmann-json/portfile.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO nlohmann/json | ||
REF v3.10.4 | ||
SHA512 f78592db6218165cbc74c10bcba40366f1bfea84405b7ee25fe97a056d5b7a15aeeb956d93296673928dcbd6e26ffcfb152f885b4a44d5d55751396ccf090835 | ||
HEAD_REF master | ||
) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
OPTIONS | ||
-DJSON_Install=ON | ||
-DJSON_MultipleHeaders=ON | ||
-DJSON_BuildTests=OFF | ||
) | ||
vcpkg_cmake_install() | ||
vcpkg_cmake_config_fixup(PACKAGE_NAME "nlohmann_json" CONFIG_PATH "lib/cmake/nlohmann_json") | ||
vcpkg_fixup_pkgconfig() | ||
|
||
vcpkg_replace_string( | ||
"${CURRENT_PACKAGES_DIR}/share/nlohmann_json/nlohmann_jsonTargets.cmake" | ||
"{_IMPORT_PREFIX}/nlohmann_json.natvis" | ||
"{_IMPORT_PREFIX}/share/nlohmann_json/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" | ||
) | ||
endif() | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") | ||
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/nlohmann_json.natvis") | ||
|
||
# Handle copyright | ||
file(INSTALL "${SOURCE_PATH}/LICENSE.MIT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) | ||
|
||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
test-feature TEST_FEATURE_WAS_SPECIFIED | ||
) | ||
|
||
if(NOT TEST_FEATURE_WAS_SPECIFIED) | ||
message(FATAL_ERROR "Test feature was not specified") | ||
endif() | ||
|
||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SPDLOG_BUILD_SHARED) |
21 changes: 21 additions & 0 deletions
21
tests/ci/vcpkg-overlay/custom-ports2/nlohmann-json/vcpkg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "nlohmann-json", | ||
"version-semver": "3.10.4", | ||
"description": "JSON for Modern C++", | ||
"homepage": "https://github.com/nlohmann/json", | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"features": { | ||
"test-feature": { | ||
"description": "Just a feature to test port overlays" | ||
} | ||
} | ||
} |
57 changes: 0 additions & 57 deletions
57
tests/ci/vcpkg-overlay/custom-ports2/spdlog-pmm/portfile.cmake
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
tests/ci/vcpkg-overlay/custom-ports2/spdlog-pmm/vcpkg.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
#include <spdlog/sinks/stdout_color_sinks.h> | ||
#include <spdlog/spdlog.h> | ||
#include <nlohmann/json.hpp> | ||
|
||
int main() { | ||
auto console = spdlog::stdout_color_mt("console"); | ||
console->info("Hello!"); | ||
} | ||
int main() { auto array = nlohmann::json::parse("[1, 2, 3]"); } |