Skip to content

Commit

Permalink
build: use a manually modified copy of nlohmann::json, closes #182
Browse files Browse the repository at this point in the history
  • Loading branch information
iboB committed Nov 4, 2024
1 parent a6109bd commit 826c2a4
Show file tree
Hide file tree
Showing 9 changed files with 24,976 additions and 14 deletions.
2 changes: 1 addition & 1 deletion acord/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ ac_dep(boost)
ac_dep(xec)

add_subdirectory(ahttp)
add_subdirectory(asset-mgr)
# add_subdirectory(asset-mgr)
4 changes: 0 additions & 4 deletions cmake/deps/nl-json.cmake

This file was deleted.

4 changes: 1 addition & 3 deletions dict/code/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Copyright (c) Alpaca Core
# SPDX-License-Identifier: MIT
#
ac_dep(nl-json)

# set(NLOHMANN_JSON_TARGET_NAME ac-json)
add_library(ac-dict INTERFACE)
add_library(ac::dict ALIAS ac-dict)
target_include_directories(ac-dict INTERFACE .)
target_link_libraries(ac-dict INTERFACE
nlohmann_json::nlohmann_json
ac::astl
)
8 changes: 5 additions & 3 deletions dict/code/ac/Dict.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
// SPDX-License-Identifier: MIT
//
#pragma once
#include <nlohmann/json.hpp>
#include "vendor/nlohmann/json.hpp"

namespace ac {

/// @defgroup cpp-dict ac::Dict
/// Dictionary type and utils.
/// @{

/// Dictionary type. A type alias for [nlohmann::json](https://github.com/nlohmann/json).
using Dict = nlohmann::json;
/// Dictionary type.
/// A type alias for [nlohmann::json](https://github.com/nlohmann/json). However to avoid conflicts with potential other
/// uses of nlohmann::json, it is renamed to acnl::json.
using Dict = acnl::json;

/// Blob (binary) carrier type.
using Blob = std::vector<uint8_t>;
Expand Down
21 changes: 21 additions & 0 deletions dict/code/ac/vendor/nlohmann/LICENSE.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2013-2022 Niels Lohmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions dict/code/ac/vendor/nlohmann/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
A copy of [nlohmann/json 3.11.3](https://github.com/nlohmann/json/tree/v3.11.3/single_include/nlohmann) with the following changes:

* namespace `nlohmann` renamed to `acnl`
* JSON_DISABLE_ENUM_SERIALIZATION is 1 by default
Loading

0 comments on commit 826c2a4

Please sign in to comment.