From 14cd019861ab7aaff55bb1a8d093efeacd80c0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20DELRIEU?= Date: Mon, 29 Jan 2018 11:21:11 +0100 Subject: [PATCH] fix cmake install directory (for real this time) * Rename 'develop' folder to 'include/nlohmann' * Rename 'src' folder to 'single_include/nlohmann' * Use headers in sources and tests * Change amalgamate config file --- CMakeLists.txt | 13 +- Makefile | 78 +++++------ .../nlohmann}/adl_serializer.hpp | 4 +- .../detail/conversions/from_json.hpp | 8 +- .../nlohmann}/detail/conversions/to_chars.hpp | 0 .../nlohmann}/detail/conversions/to_json.hpp | 4 +- .../nlohmann}/detail/exceptions.hpp | 0 .../nlohmann}/detail/input/binary_reader.hpp | 8 +- .../nlohmann}/detail/input/input_adapters.hpp | 2 +- .../nlohmann}/detail/input/lexer.hpp | 4 +- .../nlohmann}/detail/input/parser.hpp | 10 +- .../detail/iterators/internal_iterator.hpp | 2 +- .../nlohmann}/detail/iterators/iter_impl.hpp | 12 +- .../detail/iterators/iteration_proxy.hpp | 2 +- .../iterators/json_reverse_iterator.hpp | 0 .../detail/iterators/primitive_iterator.hpp | 0 .../nlohmann}/detail/json_pointer.hpp | 6 +- .../nlohmann}/detail/json_ref.hpp | 0 .../nlohmann}/detail/macro_scope.hpp | 0 .../nlohmann}/detail/macro_unscope.hpp | 0 {develop => include/nlohmann}/detail/meta.hpp | 4 +- .../nlohmann}/detail/output/binary_writer.hpp | 4 +- .../detail/output/output_adapters.hpp | 0 .../nlohmann}/detail/output/serializer.hpp | 12 +- .../nlohmann}/detail/value_t.hpp | 0 {develop => include/nlohmann}/json.hpp | 46 +++---- {develop => include/nlohmann}/json_fwd.hpp | 0 {src => single_include/nlohmann}/json.hpp | 128 +++++++++--------- test/CMakeLists.txt | 1 + test/Makefile | 8 +- test/src/fuzzer-parse_cbor.cpp | 2 +- test/src/fuzzer-parse_json.cpp | 2 +- test/src/fuzzer-parse_msgpack.cpp | 2 +- test/src/fuzzer-parse_ubjson.cpp | 2 +- test/src/unit-algorithms.cpp | 2 +- test/src/unit-allocator.cpp | 2 +- test/src/unit-capacity.cpp | 2 +- test/src/unit-cbor.cpp | 2 +- test/src/unit-class_const_iterator.cpp | 2 +- test/src/unit-class_iterator.cpp | 2 +- test/src/unit-class_lexer.cpp | 2 +- test/src/unit-class_parser.cpp | 2 +- test/src/unit-comparison.cpp | 2 +- test/src/unit-concepts.cpp | 2 +- test/src/unit-constructor1.cpp | 2 +- test/src/unit-constructor2.cpp | 2 +- test/src/unit-convenience.cpp | 2 +- test/src/unit-conversions.cpp | 2 +- test/src/unit-deserialization.cpp | 2 +- test/src/unit-element_access1.cpp | 2 +- test/src/unit-element_access2.cpp | 2 +- test/src/unit-inspection.cpp | 6 +- test/src/unit-items.cpp | 2 +- test/src/unit-iterators1.cpp | 2 +- test/src/unit-iterators2.cpp | 2 +- test/src/unit-json_patch.cpp | 2 +- test/src/unit-json_pointer.cpp | 2 +- test/src/unit-merge_patch.cpp | 2 +- test/src/unit-meta.cpp | 2 +- test/src/unit-modifiers.cpp | 2 +- test/src/unit-msgpack.cpp | 2 +- test/src/unit-noexcept.cpp | 2 +- test/src/unit-pointer_access.cpp | 2 +- test/src/unit-readme.cpp | 2 +- test/src/unit-reference_access.cpp | 2 +- test/src/unit-regression.cpp | 2 +- test/src/unit-serialization.cpp | 2 +- test/src/unit-testsuites.cpp | 2 +- test/src/unit-to_chars.cpp | 2 +- test/src/unit-ubjson.cpp | 2 +- test/src/unit-udt.cpp | 2 +- test/src/unit-unicode.cpp | 2 +- third_party/amalgamate/config.json | 6 +- 73 files changed, 226 insertions(+), 224 deletions(-) rename {develop => include/nlohmann}/adl_serializer.hpp (92%) rename {develop => include/nlohmann}/detail/conversions/from_json.hpp (98%) rename {develop => include/nlohmann}/detail/conversions/to_chars.hpp (100%) rename {develop => include/nlohmann}/detail/conversions/to_json.hpp (99%) rename {develop => include/nlohmann}/detail/exceptions.hpp (100%) rename {develop => include/nlohmann}/detail/input/binary_reader.hpp (99%) rename {develop => include/nlohmann}/detail/input/input_adapters.hpp (99%) rename {develop => include/nlohmann}/detail/input/lexer.hpp (99%) rename {develop => include/nlohmann}/detail/input/parser.hpp (98%) rename {develop => include/nlohmann}/detail/iterators/internal_iterator.hpp (91%) rename {develop => include/nlohmann}/detail/iterators/iter_impl.hpp (98%) rename {develop => include/nlohmann}/detail/iterators/iteration_proxy.hpp (98%) rename {develop => include/nlohmann}/detail/iterators/json_reverse_iterator.hpp (100%) rename {develop => include/nlohmann}/detail/iterators/primitive_iterator.hpp (100%) rename {develop => include/nlohmann}/detail/json_pointer.hpp (99%) rename {develop => include/nlohmann}/detail/json_ref.hpp (100%) rename {develop => include/nlohmann}/detail/macro_scope.hpp (100%) rename {develop => include/nlohmann}/detail/macro_unscope.hpp (100%) rename {develop => include/nlohmann}/detail/meta.hpp (99%) rename {develop => include/nlohmann}/detail/output/binary_writer.hpp (99%) rename {develop => include/nlohmann}/detail/output/output_adapters.hpp (100%) rename {develop => include/nlohmann}/detail/output/serializer.hpp (98%) rename {develop => include/nlohmann}/detail/value_t.hpp (100%) rename {develop => include/nlohmann}/json.hpp (99%) rename {develop => include/nlohmann}/json_fwd.hpp (100%) rename {src => single_include/nlohmann}/json.hpp (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e427020..ca4f49a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,6 @@ option(JSON_MultipleHeaders "Use non-amalgamated version of the library." OFF) set(NLOHMANN_JSON_TARGET_NAME ${PROJECT_NAME}) set(NLOHMANN_JSON_CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}") set(NLOHMANN_JSON_INCLUDE_INSTALL_DIR "include") -set(NLOHMANN_JSON_HEADER_INSTALL_DIR "${NLOHMANN_JSON_INCLUDE_INSTALL_DIR}/nlohmann") set(NLOHMANN_JSON_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") set(NLOHMANN_JSON_CMAKE_CONFIG_TEMPLATE "cmake/config.cmake.in") set(NLOHMANN_JSON_CMAKE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/cmake_config") @@ -32,9 +31,9 @@ set(NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/$ set(NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Config.cmake") if (JSON_MultipleHeaders) - set(NLOHMANN_JSON_SOURCE_DIR "develop/") + set(NLOHMANN_JSON_INCLUDE_BUILD_DIR "${PROJECT_SOURCE_DIR}/include/") else() - set(NLOHMANN_JSON_SOURCE_DIR "src/") + set(NLOHMANN_JSON_INCLUDE_BUILD_DIR "${PROJECT_SOURCE_DIR}/single_include/") endif() ## @@ -46,7 +45,7 @@ add_library(${NLOHMANN_JSON_TARGET_NAME} INTERFACE) target_include_directories( ${NLOHMANN_JSON_TARGET_NAME} INTERFACE - $ + $ $ ) @@ -70,7 +69,6 @@ include(CTest) #adds option BUILD_TESTING (default ON) if(BUILD_TESTING AND JSON_BuildTests) enable_testing() - include_directories(${NLOHMANN_JSON_SOURCE_DIR}) add_subdirectory(test) endif() @@ -87,9 +85,10 @@ configure_package_config_file( ${NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE} INSTALL_DESTINATION ${NLOHMANN_JSON_CONFIG_INSTALL_DIR} ) + install( - DIRECTORY ${NLOHMANN_JSON_SOURCE_DIR} - DESTINATION ${NLOHMANN_JSON_HEADER_INSTALL_DIR} + DIRECTORY ${NLOHMANN_JSON_INCLUDE_BUILD_DIR} + DESTINATION ${NLOHMANN_JSON_INCLUDE_INSTALL_DIR} ) install( FILES ${NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE} ${NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE} diff --git a/Makefile b/Makefile index 36844de8..fca2e0d3 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,39 @@ .PHONY: pretty clean ChangeLog.md -SRCS = develop/json.hpp \ - develop/json_fwd.hpp \ - develop/adl_serializer.hpp \ - develop/detail/conversions/from_json.hpp \ - develop/detail/conversions/to_chars.hpp \ - develop/detail/conversions/to_json.hpp \ - develop/detail/exceptions.hpp \ - develop/detail/input/binary_reader.hpp \ - develop/detail/input/input_adapters.hpp \ - develop/detail/input/lexer.hpp \ - develop/detail/input/parser.hpp \ - develop/detail/iterators/internal_iterator.hpp \ - develop/detail/iterators/iter_impl.hpp \ - develop/detail/iterators/iteration_proxy.hpp \ - develop/detail/iterators/json_reverse_iterator.hpp \ - develop/detail/iterators/primitive_iterator.hpp \ - develop/detail/json_pointer.hpp \ - develop/detail/json_ref.hpp \ - develop/detail/macro_scope.hpp \ - develop/detail/macro_unscope.hpp \ - develop/detail/meta.hpp \ - develop/detail/output/binary_writer.hpp \ - develop/detail/output/output_adapters.hpp \ - develop/detail/output/serializer.hpp \ - develop/detail/value_t.hpp +SRCS = include/nlohmann/json.hpp \ + include/nlohmann/json_fwd.hpp \ + include/nlohmann/adl_serializer.hpp \ + include/nlohmann/detail/conversions/from_json.hpp \ + include/nlohmann/detail/conversions/to_chars.hpp \ + include/nlohmann/detail/conversions/to_json.hpp \ + include/nlohmann/detail/exceptions.hpp \ + include/nlohmann/detail/input/binary_reader.hpp \ + include/nlohmann/detail/input/input_adapters.hpp \ + include/nlohmann/detail/input/lexer.hpp \ + include/nlohmann/detail/input/parser.hpp \ + include/nlohmann/detail/iterators/internal_iterator.hpp \ + include/nlohmann/detail/iterators/iter_impl.hpp \ + include/nlohmann/detail/iterators/iteration_proxy.hpp \ + include/nlohmann/detail/iterators/json_reverse_iterator.hpp \ + include/nlohmann/detail/iterators/primitive_iterator.hpp \ + include/nlohmann/detail/json_pointer.hpp \ + include/nlohmann/detail/json_ref.hpp \ + include/nlohmann/detail/macro_scope.hpp \ + include/nlohmann/detail/macro_unscope.hpp \ + include/nlohmann/detail/meta.hpp \ + include/nlohmann/detail/output/binary_writer.hpp \ + include/nlohmann/detail/output/output_adapters.hpp \ + include/nlohmann/detail/output/serializer.hpp \ + include/nlohmann/detail/value_t.hpp UNAME = $(shell uname) CXX=clang++ +AMALGAMATED_FILE=single_include/nlohmann/json.hpp + # main target all: - @echo "amalgamate - amalgamate file src/json.hpp from the develop sources" + @echo "amalgamate - amalgamate file single_include/nlohmann/json.hpp from the include/nlohmann sources" @echo "ChangeLog.md - generate ChangeLog file" @echo "check - compile and execute test suite" @echo "check-amalgamation - check whether sources have been amalgamated" @@ -243,7 +245,7 @@ fuzzing-stop: # call cppcheck on the main header file cppcheck: - cppcheck --enable=warning --inconclusive --force --std=c++11 src/json.hpp --error-exitcode=1 + cppcheck --enable=warning --inconclusive --force --std=c++11 $(AMALGAMATED_FILE) --error-exitcode=1 ########################################################################## @@ -257,29 +259,29 @@ pretty: --indent-col1-comments --pad-oper --pad-header --align-pointer=type \ --align-reference=type --add-brackets --convert-tabs --close-templates \ --lineend=linux --preserve-date --suffix=none --formatted \ - $(SRCS) src/json.hpp test/src/*.cpp \ + $(SRCS) $(AMALGAMATED_FILE) test/src/*.cpp \ benchmarks/src/benchmarks.cpp doc/examples/*.cpp # create single header file -amalgamate: src/json.hpp +amalgamate: $(AMALGAMATED_FILE) -src/json.hpp: $(SRCS) - third_party/amalgamate/amalgamate.py -c third_party/amalgamate/config.json -s develop --verbose=yes +$(AMALGAMATED_FILE): $(SRCS) + third_party/amalgamate/amalgamate.py -c third_party/amalgamate/config.json -s . --verbose=yes $(MAKE) pretty -# check if src/json.hpp has been amalgamated from the develop sources +# check if single_include/nlohmann/json.hpp has been amalgamated from the nlohmann sources check-amalgamation: - @mv src/json.hpp src/json.hpp~ + @mv $(AMALGAMATED_FILE) $(AMALGAMATED_FILE)~ @$(MAKE) amalgamate - @diff src/json.hpp src/json.hpp~ || (echo "===================================================================\n Amalgamation required! Please read the contribution guidelines\n in file .github/CONTRIBUTING.md.\n===================================================================" ; mv src/json.hpp~ src/json.hpp ; false) - @mv src/json.hpp~ src/json.hpp + @diff $(AMALGAMATED_FILE) $(AMALGAMATED_FILE)~ || (echo "===================================================================\n Amalgamation required! Please read the contribution guidelines\n in file .github/CONTRIBUTING.md.\n===================================================================" ; mv $(AMALGAMATED_FILE)~ $(AMALGAMATED_FILE) ; false) + @mv $(AMALGAMATED_FILE)~ $(AMALGAMATED_FILE) -# check if every header in develop includes sufficient headers to be compiled +# check if every header in nlohmann includes sufficient headers to be compiled # individually check-single-includes: for x in $(SRCS); do \ - echo "#include \"$$x\"\nint main() {}\n" | sed 's|develop/||' > single_include_test.cpp; \ - $(CXX) $(CXXFLAGS) -Idevelop -std=c++11 single_include_test.cpp -o single_include_test; \ + echo "#include <$$x>\nint main() {}\n" | sed 's|include/||' > single_include_test.cpp; \ + $(CXX) $(CXXFLAGS) -Iinclude -std=c++11 single_include_test.cpp -o single_include_test; \ rm single_include_test.cpp single_include_test; \ done diff --git a/develop/adl_serializer.hpp b/include/nlohmann/adl_serializer.hpp similarity index 92% rename from develop/adl_serializer.hpp rename to include/nlohmann/adl_serializer.hpp index cae95637..53c9009f 100644 --- a/develop/adl_serializer.hpp +++ b/include/nlohmann/adl_serializer.hpp @@ -2,8 +2,8 @@ #include -#include "detail/conversions/from_json.hpp" -#include "detail/conversions/to_json.hpp" +#include +#include namespace nlohmann { diff --git a/develop/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp similarity index 98% rename from develop/detail/conversions/from_json.hpp rename to include/nlohmann/detail/conversions/from_json.hpp index ba89e540..8ea0284a 100644 --- a/develop/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -11,10 +11,10 @@ #include // pair, declval #include // valarray -#include "detail/exceptions.hpp" -#include "detail/macro_scope.hpp" -#include "detail/meta.hpp" -#include "detail/value_t.hpp" +#include +#include +#include +#include namespace nlohmann { diff --git a/develop/detail/conversions/to_chars.hpp b/include/nlohmann/detail/conversions/to_chars.hpp similarity index 100% rename from develop/detail/conversions/to_chars.hpp rename to include/nlohmann/detail/conversions/to_chars.hpp diff --git a/develop/detail/conversions/to_json.hpp b/include/nlohmann/detail/conversions/to_json.hpp similarity index 99% rename from develop/detail/conversions/to_json.hpp rename to include/nlohmann/detail/conversions/to_json.hpp index 2df7b0b8..ce2bc0aa 100644 --- a/develop/detail/conversions/to_json.hpp +++ b/include/nlohmann/detail/conversions/to_json.hpp @@ -8,8 +8,8 @@ #include // valarray #include // vector -#include "detail/meta.hpp" -#include "detail/value_t.hpp" +#include +#include namespace nlohmann { diff --git a/develop/detail/exceptions.hpp b/include/nlohmann/detail/exceptions.hpp similarity index 100% rename from develop/detail/exceptions.hpp rename to include/nlohmann/detail/exceptions.hpp diff --git a/develop/detail/input/binary_reader.hpp b/include/nlohmann/detail/input/binary_reader.hpp similarity index 99% rename from develop/detail/input/binary_reader.hpp rename to include/nlohmann/detail/input/binary_reader.hpp index ce48fd93..057429cf 100644 --- a/develop/detail/input/binary_reader.hpp +++ b/include/nlohmann/detail/input/binary_reader.hpp @@ -15,10 +15,10 @@ #include // char_traits, string #include // make_pair, move -#include "detail/input/input_adapters.hpp" -#include "detail/exceptions.hpp" -#include "detail/macro_scope.hpp" -#include "detail/value_t.hpp" +#include +#include +#include +#include namespace nlohmann { diff --git a/develop/detail/input/input_adapters.hpp b/include/nlohmann/detail/input/input_adapters.hpp similarity index 99% rename from develop/detail/input/input_adapters.hpp rename to include/nlohmann/detail/input/input_adapters.hpp index abbf5d29..ef66948d 100644 --- a/develop/detail/input/input_adapters.hpp +++ b/include/nlohmann/detail/input/input_adapters.hpp @@ -14,7 +14,7 @@ #include // enable_if, is_base_of, is_pointer, is_integral, remove_pointer #include // pair, declval -#include "detail/macro_scope.hpp" +#include namespace nlohmann { diff --git a/develop/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp similarity index 99% rename from develop/detail/input/lexer.hpp rename to include/nlohmann/detail/input/lexer.hpp index 2b99c137..75001652 100644 --- a/develop/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -10,8 +10,8 @@ #include // char_traits, string #include // vector -#include "detail/macro_scope.hpp" -#include "detail/input/input_adapters.hpp" +#include +#include namespace nlohmann { diff --git a/develop/detail/input/parser.hpp b/include/nlohmann/detail/input/parser.hpp similarity index 98% rename from develop/detail/input/parser.hpp rename to include/nlohmann/detail/input/parser.hpp index 799ea920..63e8541f 100644 --- a/develop/detail/input/parser.hpp +++ b/include/nlohmann/detail/input/parser.hpp @@ -7,11 +7,11 @@ #include // string #include // move -#include "detail/exceptions.hpp" -#include "detail/macro_scope.hpp" -#include "detail/input/input_adapters.hpp" -#include "detail/input/lexer.hpp" -#include "detail/value_t.hpp" +#include +#include +#include +#include +#include namespace nlohmann { diff --git a/develop/detail/iterators/internal_iterator.hpp b/include/nlohmann/detail/iterators/internal_iterator.hpp similarity index 91% rename from develop/detail/iterators/internal_iterator.hpp rename to include/nlohmann/detail/iterators/internal_iterator.hpp index b65b33d3..d9b8fb29 100644 --- a/develop/detail/iterators/internal_iterator.hpp +++ b/include/nlohmann/detail/iterators/internal_iterator.hpp @@ -1,6 +1,6 @@ #pragma once -#include "detail/iterators/primitive_iterator.hpp" +#include namespace nlohmann { diff --git a/develop/detail/iterators/iter_impl.hpp b/include/nlohmann/detail/iterators/iter_impl.hpp similarity index 98% rename from develop/detail/iterators/iter_impl.hpp rename to include/nlohmann/detail/iterators/iter_impl.hpp index 2934389b..52ede17b 100644 --- a/develop/detail/iterators/iter_impl.hpp +++ b/include/nlohmann/detail/iterators/iter_impl.hpp @@ -4,12 +4,12 @@ #include // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next #include // conditional, is_const, remove_const -#include "detail/exceptions.hpp" -#include "detail/iterators/internal_iterator.hpp" -#include "detail/iterators/primitive_iterator.hpp" -#include "detail/macro_scope.hpp" -#include "detail/meta.hpp" -#include "detail/value_t.hpp" +#include +#include +#include +#include +#include +#include namespace nlohmann { diff --git a/develop/detail/iterators/iteration_proxy.hpp b/include/nlohmann/detail/iterators/iteration_proxy.hpp similarity index 98% rename from develop/detail/iterators/iteration_proxy.hpp rename to include/nlohmann/detail/iterators/iteration_proxy.hpp index 1a699542..7547d038 100644 --- a/develop/detail/iterators/iteration_proxy.hpp +++ b/include/nlohmann/detail/iterators/iteration_proxy.hpp @@ -3,7 +3,7 @@ #include // size_t #include // string, to_string -#include "detail/value_t.hpp" +#include namespace nlohmann { diff --git a/develop/detail/iterators/json_reverse_iterator.hpp b/include/nlohmann/detail/iterators/json_reverse_iterator.hpp similarity index 100% rename from develop/detail/iterators/json_reverse_iterator.hpp rename to include/nlohmann/detail/iterators/json_reverse_iterator.hpp diff --git a/develop/detail/iterators/primitive_iterator.hpp b/include/nlohmann/detail/iterators/primitive_iterator.hpp similarity index 100% rename from develop/detail/iterators/primitive_iterator.hpp rename to include/nlohmann/detail/iterators/primitive_iterator.hpp diff --git a/develop/detail/json_pointer.hpp b/include/nlohmann/detail/json_pointer.hpp similarity index 99% rename from develop/detail/json_pointer.hpp rename to include/nlohmann/detail/json_pointer.hpp index 9cbbfb36..fce8001a 100644 --- a/develop/detail/json_pointer.hpp +++ b/include/nlohmann/detail/json_pointer.hpp @@ -5,9 +5,9 @@ #include // string #include // vector -#include "detail/macro_scope.hpp" -#include "detail/exceptions.hpp" -#include "detail/value_t.hpp" +#include +#include +#include namespace nlohmann { diff --git a/develop/detail/json_ref.hpp b/include/nlohmann/detail/json_ref.hpp similarity index 100% rename from develop/detail/json_ref.hpp rename to include/nlohmann/detail/json_ref.hpp diff --git a/develop/detail/macro_scope.hpp b/include/nlohmann/detail/macro_scope.hpp similarity index 100% rename from develop/detail/macro_scope.hpp rename to include/nlohmann/detail/macro_scope.hpp diff --git a/develop/detail/macro_unscope.hpp b/include/nlohmann/detail/macro_unscope.hpp similarity index 100% rename from develop/detail/macro_unscope.hpp rename to include/nlohmann/detail/macro_unscope.hpp diff --git a/develop/detail/meta.hpp b/include/nlohmann/detail/meta.hpp similarity index 99% rename from develop/detail/meta.hpp rename to include/nlohmann/detail/meta.hpp index 585b8d44..49f1069f 100644 --- a/develop/detail/meta.hpp +++ b/include/nlohmann/detail/meta.hpp @@ -6,8 +6,8 @@ #include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type #include // declval -#include "json_fwd.hpp" -#include "detail/macro_scope.hpp" +#include +#include namespace nlohmann { diff --git a/develop/detail/output/binary_writer.hpp b/include/nlohmann/detail/output/binary_writer.hpp similarity index 99% rename from develop/detail/output/binary_writer.hpp rename to include/nlohmann/detail/output/binary_writer.hpp index fdf9a216..10183262 100644 --- a/develop/detail/output/binary_writer.hpp +++ b/include/nlohmann/detail/output/binary_writer.hpp @@ -6,8 +6,8 @@ #include // memcpy #include // numeric_limits -#include "detail/input/binary_reader.hpp" -#include "detail/output/output_adapters.hpp" +#include +#include namespace nlohmann { diff --git a/develop/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp similarity index 100% rename from develop/detail/output/output_adapters.hpp rename to include/nlohmann/detail/output/output_adapters.hpp diff --git a/develop/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp similarity index 98% rename from develop/detail/output/serializer.hpp rename to include/nlohmann/detail/output/serializer.hpp index 5ad4796c..a6442644 100644 --- a/develop/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -16,12 +16,12 @@ #include // stringstream #include // is_same -#include "detail/exceptions.hpp" -#include "detail/conversions/to_chars.hpp" -#include "detail/macro_scope.hpp" -#include "detail/meta.hpp" -#include "detail/output/output_adapters.hpp" -#include "detail/value_t.hpp" +#include +#include +#include +#include +#include +#include namespace nlohmann { diff --git a/develop/detail/value_t.hpp b/include/nlohmann/detail/value_t.hpp similarity index 100% rename from develop/detail/value_t.hpp rename to include/nlohmann/detail/value_t.hpp diff --git a/develop/json.hpp b/include/nlohmann/json.hpp similarity index 99% rename from develop/json.hpp rename to include/nlohmann/json.hpp index e1e6d3fd..0ab7d007 100644 --- a/develop/json.hpp +++ b/include/nlohmann/json.hpp @@ -45,28 +45,28 @@ SOFTWARE. #include // string, stoi, to_string #include // declval, forward, move, pair, swap -#include "json_fwd.hpp" -#include "detail/macro_scope.hpp" -#include "detail/meta.hpp" -#include "detail/exceptions.hpp" -#include "detail/value_t.hpp" -#include "detail/conversions/from_json.hpp" -#include "detail/conversions/to_json.hpp" -#include "detail/input/input_adapters.hpp" -#include "detail/input/lexer.hpp" -#include "detail/input/parser.hpp" -#include "detail/iterators/primitive_iterator.hpp" -#include "detail/iterators/internal_iterator.hpp" -#include "detail/iterators/iter_impl.hpp" -#include "detail/iterators/iteration_proxy.hpp" -#include "detail/iterators/json_reverse_iterator.hpp" -#include "detail/output/output_adapters.hpp" -#include "detail/input/binary_reader.hpp" -#include "detail/output/binary_writer.hpp" -#include "detail/output/serializer.hpp" -#include "detail/json_ref.hpp" -#include "detail/json_pointer.hpp" -#include "adl_serializer.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /*! @brief namespace for Niels Lohmann @@ -7564,6 +7564,6 @@ inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std return nlohmann::json::json_pointer(std::string(s, n)); } -#include "detail/macro_unscope.hpp" +#include #endif diff --git a/develop/json_fwd.hpp b/include/nlohmann/json_fwd.hpp similarity index 100% rename from develop/json_fwd.hpp rename to include/nlohmann/json_fwd.hpp diff --git a/src/json.hpp b/single_include/nlohmann/json.hpp similarity index 99% rename from src/json.hpp rename to single_include/nlohmann/json.hpp index 7dbce3b8..6c19d1e4 100644 --- a/src/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -45,7 +45,7 @@ SOFTWARE. #include // string, stoi, to_string #include // declval, forward, move, pair, swap -// #include "json_fwd.hpp" +// #include #ifndef NLOHMANN_JSON_FWD_HPP #define NLOHMANN_JSON_FWD_HPP @@ -111,7 +111,7 @@ using json = basic_json<>; #endif -// #include "detail/macro_scope.hpp" +// #include // This file contains all internal macro definitions @@ -228,7 +228,7 @@ contains a `mapped_type`, whereas `std::vector` fails the test. std::is_integral()))>::value; \ } -// #include "detail/meta.hpp" +// #include #include // not @@ -237,9 +237,9 @@ contains a `mapped_type`, whereas `std::vector` fails the test. #include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type #include // declval -// #include "json_fwd.hpp" +// #include -// #include "detail/macro_scope.hpp" +// #include namespace nlohmann @@ -490,7 +490,7 @@ constexpr T static_const::value; } } -// #include "detail/exceptions.hpp" +// #include #include // exception @@ -821,7 +821,7 @@ class other_error : public exception } } -// #include "detail/value_t.hpp" +// #include #include // array @@ -899,7 +899,7 @@ inline bool operator<(const value_t lhs, const value_t rhs) noexcept } } -// #include "detail/conversions/from_json.hpp" +// #include #include // transform @@ -913,13 +913,13 @@ inline bool operator<(const value_t lhs, const value_t rhs) noexcept #include // pair, declval #include // valarray -// #include "detail/exceptions.hpp" +// #include -// #include "detail/macro_scope.hpp" +// #include -// #include "detail/meta.hpp" +// #include -// #include "detail/value_t.hpp" +// #include namespace nlohmann @@ -1220,7 +1220,7 @@ constexpr const auto& from_json = detail::static_const::va } } -// #include "detail/conversions/to_json.hpp" +// #include #include // or, and, not @@ -1231,9 +1231,9 @@ constexpr const auto& from_json = detail::static_const::va #include // valarray #include // vector -// #include "detail/meta.hpp" +// #include -// #include "detail/value_t.hpp" +// #include namespace nlohmann @@ -1562,7 +1562,7 @@ constexpr const auto& to_json = detail::static_const::value; } } -// #include "detail/input/input_adapters.hpp" +// #include #include // min @@ -1579,7 +1579,7 @@ constexpr const auto& to_json = detail::static_const::value; #include // enable_if, is_base_of, is_pointer, is_integral, remove_pointer #include // pair, declval -// #include "detail/macro_scope.hpp" +// #include namespace nlohmann @@ -1827,7 +1827,7 @@ class input_adapter } } -// #include "detail/input/lexer.hpp" +// #include #include // localeconv @@ -1840,9 +1840,9 @@ class input_adapter #include // char_traits, string #include // vector -// #include "detail/macro_scope.hpp" +// #include -// #include "detail/input/input_adapters.hpp" +// #include namespace nlohmann @@ -3108,7 +3108,7 @@ scan_number_done: } } -// #include "detail/input/parser.hpp" +// #include #include // assert @@ -3118,15 +3118,15 @@ scan_number_done: #include // string #include // move -// #include "detail/exceptions.hpp" +// #include -// #include "detail/macro_scope.hpp" +// #include -// #include "detail/input/input_adapters.hpp" +// #include -// #include "detail/input/lexer.hpp" +// #include -// #include "detail/value_t.hpp" +// #include namespace nlohmann @@ -3704,7 +3704,7 @@ class parser } } -// #include "detail/iterators/primitive_iterator.hpp" +// #include #include // ptrdiff_t @@ -3826,10 +3826,10 @@ class primitive_iterator_t } } -// #include "detail/iterators/internal_iterator.hpp" +// #include -// #include "detail/iterators/primitive_iterator.hpp" +// #include namespace nlohmann @@ -3854,24 +3854,24 @@ template struct internal_iterator } } -// #include "detail/iterators/iter_impl.hpp" +// #include #include // not #include // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next #include // conditional, is_const, remove_const -// #include "detail/exceptions.hpp" +// #include -// #include "detail/iterators/internal_iterator.hpp" +// #include -// #include "detail/iterators/primitive_iterator.hpp" +// #include -// #include "detail/macro_scope.hpp" +// #include -// #include "detail/meta.hpp" +// #include -// #include "detail/value_t.hpp" +// #include namespace nlohmann @@ -4476,13 +4476,13 @@ class iter_impl } } -// #include "detail/iterators/iteration_proxy.hpp" +// #include #include // size_t #include // string, to_string -// #include "detail/value_t.hpp" +// #include namespace nlohmann @@ -4577,7 +4577,7 @@ template class iteration_proxy } } -// #include "detail/iterators/json_reverse_iterator.hpp" +// #include #include // ptrdiff_t @@ -4698,7 +4698,7 @@ class json_reverse_iterator : public std::reverse_iterator } } -// #include "detail/output/output_adapters.hpp" +// #include #include // copy @@ -4813,7 +4813,7 @@ class output_adapter } } -// #include "detail/input/binary_reader.hpp" +// #include #include // generate_n @@ -4831,13 +4831,13 @@ class output_adapter #include // char_traits, string #include // make_pair, move -// #include "detail/input/input_adapters.hpp" +// #include -// #include "detail/exceptions.hpp" +// #include -// #include "detail/macro_scope.hpp" +// #include -// #include "detail/value_t.hpp" +// #include namespace nlohmann @@ -6180,7 +6180,7 @@ class binary_reader } } -// #include "detail/output/binary_writer.hpp" +// #include #include // reverse @@ -6189,9 +6189,9 @@ class binary_reader #include // memcpy #include // numeric_limits -// #include "detail/input/binary_reader.hpp" +// #include -// #include "detail/output/output_adapters.hpp" +// #include namespace nlohmann @@ -7093,7 +7093,7 @@ class binary_writer } } -// #include "detail/output/serializer.hpp" +// #include #include // reverse, remove, fill, find, none_of @@ -7112,9 +7112,9 @@ class binary_writer #include // stringstream #include // is_same -// #include "detail/exceptions.hpp" +// #include -// #include "detail/conversions/to_chars.hpp" +// #include #include // assert @@ -8211,13 +8211,13 @@ char* to_chars(char* first, char* last, FloatType value) } // namespace detail } // namespace nlohmann -// #include "detail/macro_scope.hpp" +// #include -// #include "detail/meta.hpp" +// #include -// #include "detail/output/output_adapters.hpp" +// #include -// #include "detail/value_t.hpp" +// #include namespace nlohmann @@ -8830,7 +8830,7 @@ class serializer } } -// #include "detail/json_ref.hpp" +// #include #include @@ -8895,7 +8895,7 @@ class json_ref } } -// #include "detail/json_pointer.hpp" +// #include #include // assert @@ -8903,11 +8903,11 @@ class json_ref #include // string #include // vector -// #include "detail/macro_scope.hpp" +// #include -// #include "detail/exceptions.hpp" +// #include -// #include "detail/value_t.hpp" +// #include namespace nlohmann @@ -9596,14 +9596,14 @@ class json_pointer }; } -// #include "adl_serializer.hpp" +// #include #include -// #include "detail/conversions/from_json.hpp" +// #include -// #include "detail/conversions/to_json.hpp" +// #include namespace nlohmann @@ -17142,7 +17142,7 @@ inline nlohmann::json::json_pointer operator "" _json_pointer(const char* s, std return nlohmann::json::json_pointer(std::string(s, n)); } -// #include "detail/macro_unscope.hpp" +// #include // restore GCC/clang diagnostic settings diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 89f5c221..ddce7e0f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -101,6 +101,7 @@ foreach(file ${files}) target_compile_definitions(${testcase} PRIVATE CATCH_CONFIG_FAST_COMPILE) target_include_directories(${testcase} PRIVATE "thirdparty/catch") + target_include_directories(${testcase} PRIVATE ${NLOHMANN_JSON_INCLUDE_BUILD_DIR}) target_link_libraries(${testcase} ${NLOHMANN_JSON_TARGET_NAME}) if(NOT MSVC) diff --git a/test/Makefile b/test/Makefile index 91dd7654..4dc39916 100644 --- a/test/Makefile +++ b/test/Makefile @@ -4,7 +4,7 @@ # additional flags CXXFLAGS += -std=c++11 -Wall -Wextra -pedantic -Wcast-align -Wcast-qual -Wno-ctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch -Wundef -Wno-unused -Wnon-virtual-dtor -Wreorder -Wdeprecated -Wno-float-equal -CPPFLAGS += -I ../src -I . -I thirdparty/catch -DCATCH_CONFIG_FAST_COMPILE +CPPFLAGS += -I ../single_include -I . -I thirdparty/catch -DCATCH_CONFIG_FAST_COMPILE SOURCES = src/unit.cpp \ src/unit-algorithms.cpp \ @@ -60,11 +60,11 @@ clean: # single test file ############################################################################## -json_unit: $(OBJECTS) ../src/json.hpp thirdparty/catch/catch.hpp +json_unit: $(OBJECTS) ../single_include/nlohmann/json.hpp thirdparty/catch/catch.hpp @echo "[CXXLD] $@" @$(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ -%.o: %.cpp ../src/json.hpp thirdparty/catch/catch.hpp +%.o: %.cpp ../single_include/nlohmann/json.hpp thirdparty/catch/catch.hpp @echo "[CXX] $@" @$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ @@ -73,7 +73,7 @@ json_unit: $(OBJECTS) ../src/json.hpp thirdparty/catch/catch.hpp # individual test cases ############################################################################## -test-%: src/unit-%.o src/unit.o ../src/json.hpp thirdparty/catch/catch.hpp +test-%: src/unit-%.o src/unit.o ../single_include/nlohmann/json.hpp thirdparty/catch/catch.hpp @echo "[CXXLD] $@" @$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $< src/unit.o -o $@ diff --git a/test/src/fuzzer-parse_cbor.cpp b/test/src/fuzzer-parse_cbor.cpp index 576407bb..72978e54 100644 --- a/test/src/fuzzer-parse_cbor.cpp +++ b/test/src/fuzzer-parse_cbor.cpp @@ -20,7 +20,7 @@ Licensed under the MIT License . #include #include -#include +#include using json = nlohmann::json; diff --git a/test/src/fuzzer-parse_json.cpp b/test/src/fuzzer-parse_json.cpp index 6b2b1154..86a8f7fb 100644 --- a/test/src/fuzzer-parse_json.cpp +++ b/test/src/fuzzer-parse_json.cpp @@ -21,7 +21,7 @@ Licensed under the MIT License . #include #include -#include +#include using json = nlohmann::json; diff --git a/test/src/fuzzer-parse_msgpack.cpp b/test/src/fuzzer-parse_msgpack.cpp index c3f9eb5d..03da5759 100644 --- a/test/src/fuzzer-parse_msgpack.cpp +++ b/test/src/fuzzer-parse_msgpack.cpp @@ -20,7 +20,7 @@ Licensed under the MIT License . #include #include -#include +#include using json = nlohmann::json; diff --git a/test/src/fuzzer-parse_ubjson.cpp b/test/src/fuzzer-parse_ubjson.cpp index 947d96e0..1980f684 100644 --- a/test/src/fuzzer-parse_ubjson.cpp +++ b/test/src/fuzzer-parse_ubjson.cpp @@ -20,7 +20,7 @@ Licensed under the MIT License . #include #include -#include +#include using json = nlohmann::json; diff --git a/test/src/unit-algorithms.cpp b/test/src/unit-algorithms.cpp index f74ca72e..001f566e 100644 --- a/test/src/unit-algorithms.cpp +++ b/test/src/unit-algorithms.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("algorithms") diff --git a/test/src/unit-allocator.cpp b/test/src/unit-allocator.cpp index a182d989..9fdb41cb 100644 --- a/test/src/unit-allocator.cpp +++ b/test/src/unit-allocator.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; // special test case to check if memory is leaked if constructor throws diff --git a/test/src/unit-capacity.cpp b/test/src/unit-capacity.cpp index 4df512a8..1c0d573a 100644 --- a/test/src/unit-capacity.cpp +++ b/test/src/unit-capacity.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("capacity") diff --git a/test/src/unit-cbor.cpp b/test/src/unit-cbor.cpp index 43fca028..41b2e15c 100644 --- a/test/src/unit-cbor.cpp +++ b/test/src/unit-cbor.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-class_const_iterator.cpp b/test/src/unit-class_const_iterator.cpp index 5ecc9d6a..cf6777e9 100644 --- a/test/src/unit-class_const_iterator.cpp +++ b/test/src/unit-class_const_iterator.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("const_iterator class") diff --git a/test/src/unit-class_iterator.cpp b/test/src/unit-class_iterator.cpp index 45f28ef6..168988d6 100644 --- a/test/src/unit-class_iterator.cpp +++ b/test/src/unit-class_iterator.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("iterator class") diff --git a/test/src/unit-class_lexer.cpp b/test/src/unit-class_lexer.cpp index 45355cd7..4ae7e77c 100644 --- a/test/src/unit-class_lexer.cpp +++ b/test/src/unit-class_lexer.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; // shortcut to scan a string literal diff --git a/test/src/unit-class_parser.cpp b/test/src/unit-class_parser.cpp index 91fd1819..ad1a9723 100644 --- a/test/src/unit-class_parser.cpp +++ b/test/src/unit-class_parser.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-comparison.cpp b/test/src/unit-comparison.cpp index dbd7788b..3ca7d552 100644 --- a/test/src/unit-comparison.cpp +++ b/test/src/unit-comparison.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; // helper function to check std::less diff --git a/test/src/unit-concepts.cpp b/test/src/unit-concepts.cpp index dea1238d..29be62dd 100644 --- a/test/src/unit-concepts.cpp +++ b/test/src/unit-concepts.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("concepts") diff --git a/test/src/unit-constructor1.cpp b/test/src/unit-constructor1.cpp index 33a4f677..b1aafc34 100644 --- a/test/src/unit-constructor1.cpp +++ b/test/src/unit-constructor1.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-constructor2.cpp b/test/src/unit-constructor2.cpp index 58545ad0..5cb33fa4 100644 --- a/test/src/unit-constructor2.cpp +++ b/test/src/unit-constructor2.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("other constructors and destructor") diff --git a/test/src/unit-convenience.cpp b/test/src/unit-convenience.cpp index f74c00ae..fc04d4a6 100644 --- a/test/src/unit-convenience.cpp +++ b/test/src/unit-convenience.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; void check_escaped(const char* original, const char* escaped = "", const bool ensure_ascii = false); diff --git a/test/src/unit-conversions.cpp b/test/src/unit-conversions.cpp index f9d49a83..38c3d8dd 100644 --- a/test/src/unit-conversions.cpp +++ b/test/src/unit-conversions.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-deserialization.cpp b/test/src/unit-deserialization.cpp index 1da791a9..e790f21a 100644 --- a/test/src/unit-deserialization.cpp +++ b/test/src/unit-deserialization.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-element_access1.cpp b/test/src/unit-element_access1.cpp index e288cb5c..cc9b3ff4 100644 --- a/test/src/unit-element_access1.cpp +++ b/test/src/unit-element_access1.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("element access 1") diff --git a/test/src/unit-element_access2.cpp b/test/src/unit-element_access2.cpp index 8f628f69..4a566b15 100644 --- a/test/src/unit-element_access2.cpp +++ b/test/src/unit-element_access2.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("element access 2") diff --git a/test/src/unit-inspection.cpp b/test/src/unit-inspection.cpp index 21f637aa..b4fdb9a6 100644 --- a/test/src/unit-inspection.cpp +++ b/test/src/unit-inspection.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #include -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("object inspection") @@ -316,8 +316,8 @@ TEST_CASE("object inspection") SECTION("round trips") { for (const auto& s : - {"3.141592653589793", "1000000000000000010E5" - }) + {"3.141592653589793", "1000000000000000010E5" + }) { json j1 = json::parse(s); std::string s1 = j1.dump(); diff --git a/test/src/unit-items.cpp b/test/src/unit-items.cpp index 4f5bd15d..9d455204 100644 --- a/test/src/unit-items.cpp +++ b/test/src/unit-items.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("iterator_wrapper") diff --git a/test/src/unit-iterators1.cpp b/test/src/unit-iterators1.cpp index 8c5eddba..ea789fa3 100644 --- a/test/src/unit-iterators1.cpp +++ b/test/src/unit-iterators1.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("iterators 1") diff --git a/test/src/unit-iterators2.cpp b/test/src/unit-iterators2.cpp index d872890f..b778f040 100644 --- a/test/src/unit-iterators2.cpp +++ b/test/src/unit-iterators2.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("iterators 2") diff --git a/test/src/unit-json_patch.cpp b/test/src/unit-json_patch.cpp index 3490f704..c69b3f07 100644 --- a/test/src/unit-json_patch.cpp +++ b/test/src/unit-json_patch.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-json_pointer.cpp b/test/src/unit-json_pointer.cpp index 7a493347..d6b61494 100644 --- a/test/src/unit-json_pointer.cpp +++ b/test/src/unit-json_pointer.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("JSON pointers") diff --git a/test/src/unit-merge_patch.cpp b/test/src/unit-merge_patch.cpp index 79bbaa2a..88720766 100644 --- a/test/src/unit-merge_patch.cpp +++ b/test/src/unit-merge_patch.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("JSON Merge Patch") diff --git a/test/src/unit-meta.cpp b/test/src/unit-meta.cpp index f6e9d6f4..63d9abad 100644 --- a/test/src/unit-meta.cpp +++ b/test/src/unit-meta.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("version information") diff --git a/test/src/unit-modifiers.cpp b/test/src/unit-modifiers.cpp index 44b9cf2b..3b31bda9 100644 --- a/test/src/unit-modifiers.cpp +++ b/test/src/unit-modifiers.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("modifiers") diff --git a/test/src/unit-msgpack.cpp b/test/src/unit-msgpack.cpp index 531012b7..81aa3637 100644 --- a/test/src/unit-msgpack.cpp +++ b/test/src/unit-msgpack.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-noexcept.cpp b/test/src/unit-noexcept.cpp index 56ca4a41..6d0fd359 100644 --- a/test/src/unit-noexcept.cpp +++ b/test/src/unit-noexcept.cpp @@ -27,7 +27,7 @@ SOFTWARE. */ #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; diff --git a/test/src/unit-pointer_access.cpp b/test/src/unit-pointer_access.cpp index 19254907..eec88ed3 100644 --- a/test/src/unit-pointer_access.cpp +++ b/test/src/unit-pointer_access.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("pointer access") diff --git a/test/src/unit-readme.cpp b/test/src/unit-readme.cpp index ebf10583..ade0e0a5 100644 --- a/test/src/unit-readme.cpp +++ b/test/src/unit-readme.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-reference_access.cpp b/test/src/unit-reference_access.cpp index ea84c9e7..a87a0c54 100644 --- a/test/src/unit-reference_access.cpp +++ b/test/src/unit-reference_access.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("reference access") diff --git a/test/src/unit-regression.cpp b/test/src/unit-regression.cpp index c4a04775..bcdb4ace 100644 --- a/test/src/unit-regression.cpp +++ b/test/src/unit-regression.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-serialization.cpp b/test/src/unit-serialization.cpp index 5668b7ba..2f667f41 100644 --- a/test/src/unit-serialization.cpp +++ b/test/src/unit-serialization.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; TEST_CASE("serialization") diff --git a/test/src/unit-testsuites.cpp b/test/src/unit-testsuites.cpp index f88bc9d0..bd813aa5 100644 --- a/test/src/unit-testsuites.cpp +++ b/test/src/unit-testsuites.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-to_chars.cpp b/test/src/unit-to_chars.cpp index 973e4e19..dffeaed0 100644 --- a/test/src/unit-to_chars.cpp +++ b/test/src/unit-to_chars.cpp @@ -32,7 +32,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::detail::dtoa_impl::reinterpret_bits; static float make_float(uint32_t sign_bit, uint32_t biased_exponent, uint32_t significand) diff --git a/test/src/unit-ubjson.cpp b/test/src/unit-ubjson.cpp index 144fcfe1..f0492702 100644 --- a/test/src/unit-ubjson.cpp +++ b/test/src/unit-ubjson.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/test/src/unit-udt.cpp b/test/src/unit-udt.cpp index a4adc3be..44204151 100644 --- a/test/src/unit-udt.cpp +++ b/test/src/unit-udt.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include "catch.hpp" -#include "json.hpp" +#include using nlohmann::json; diff --git a/test/src/unit-unicode.cpp b/test/src/unit-unicode.cpp index 97fc2751..82a29204 100644 --- a/test/src/unit-unicode.cpp +++ b/test/src/unit-unicode.cpp @@ -29,7 +29,7 @@ SOFTWARE. #include "catch.hpp" #define private public -#include "json.hpp" +#include using nlohmann::json; #include diff --git a/third_party/amalgamate/config.json b/third_party/amalgamate/config.json index ce937e65..32fc21cf 100644 --- a/third_party/amalgamate/config.json +++ b/third_party/amalgamate/config.json @@ -1,8 +1,8 @@ { "project": "JSON for Modern C++", - "target": "src/json.hpp", + "target": "single_include/nlohmann/json.hpp", "sources": [ - "json.hpp" + "include/nlohmann/json.hpp" ], - "include_paths": ["."] + "include_paths": ["include"] }