mirror of
https://github.com/nlohmann/json.git
synced 2025-01-19 07:43:03 +08:00
♻️ reorganized code
This commit is contained in:
parent
b67e00b9b5
commit
0a2920e0fd
@ -68,18 +68,26 @@ if(BUILD_TESTING AND JSON_BuildTests)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(amalgamate
|
||||
GIT_REPOSITORY "https://github.com/theodelrieu/Amalgamate"
|
||||
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}"
|
||||
)
|
||||
##
|
||||
## AMALGAMATION
|
||||
## create a single header file
|
||||
##
|
||||
option(JSON_Amalgamate "Build and use amalgamation" OFF)
|
||||
|
||||
# There is no way to tell amalgamate to force-write the output file even if it already exists...
|
||||
add_custom_target(single_header ALL rm -f "${CMAKE_SOURCE_DIR}/single_header/json.hpp"
|
||||
COMMENT "Amalgamating json.hpp..."
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/${NLOHMANN_JSON_SOURCE_DIR}
|
||||
DEPENDS amalgamate
|
||||
COMMAND "${CMAKE_BINARY_DIR}/bin/amalgamate" -w '*.hpp' -i . json.hpp "${CMAKE_SOURCE_DIR}/single_header/json.hpp"
|
||||
)
|
||||
if(JSON_Amalgamate)
|
||||
ExternalProject_Add(amalgamate
|
||||
GIT_REPOSITORY "https://github.com/theodelrieu/Amalgamate"
|
||||
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}"
|
||||
)
|
||||
|
||||
# There is no way to tell amalgamate to force-write the output file even if it already exists...
|
||||
add_custom_target(single_header ALL rm -f "${CMAKE_SOURCE_DIR}/${NLOHMANN_JSON_SOURCE_DIR}/json.hpp"
|
||||
COMMENT "Amalgamating json.hpp..."
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/develop
|
||||
DEPENDS amalgamate
|
||||
COMMAND "${CMAKE_BINARY_DIR}/bin/amalgamate" -w '*.hpp' -i . json.hpp "${CMAKE_SOURCE_DIR}/${NLOHMANN_JSON_SOURCE_DIR}/json.hpp"
|
||||
)
|
||||
endif()
|
||||
|
||||
##
|
||||
## INSTALL
|
||||
|
45
Makefile
45
Makefile
@ -1,29 +1,30 @@
|
||||
.PHONY: pretty clean ChangeLog.md
|
||||
|
||||
SRCDIR = ./src
|
||||
DEVDIR = ./develop
|
||||
SRCS = $(SRCDIR)/json.hpp \
|
||||
$(SRCDIR)/json_fwd.hpp \
|
||||
$(SRCDIR)/detail/macro_scope.hpp \
|
||||
$(SRCDIR)/detail/macro_unscope.hpp \
|
||||
$(SRCDIR)/detail/meta.hpp \
|
||||
$(SRCDIR)/detail/exceptions.hpp \
|
||||
$(SRCDIR)/detail/value_t.hpp \
|
||||
$(SRCDIR)/detail/conversions/from_json.hpp \
|
||||
$(SRCDIR)/detail/conversions/to_json.hpp \
|
||||
$(SRCDIR)/detail/parsing/input_adapters.hpp \
|
||||
$(SRCDIR)/detail/parsing/lexer.hpp \
|
||||
$(SRCDIR)/detail/parsing/parser.hpp \
|
||||
$(SRCDIR)/detail/iterators/primitive_iterator.hpp \
|
||||
$(SRCDIR)/detail/iterators/internal_iterator.hpp \
|
||||
$(SRCDIR)/detail/iterators/iter_impl.hpp \
|
||||
$(SRCDIR)/detail/iterators/iteration_proxy.hpp \
|
||||
$(SRCDIR)/detail/iterators/json_reverse_iterator.hpp \
|
||||
$(SRCDIR)/detail/parsing/output_adapters.hpp \
|
||||
$(SRCDIR)/detail/parsing/binary_reader.hpp \
|
||||
$(SRCDIR)/detail/parsing/binary_writer.hpp \
|
||||
$(SRCDIR)/detail/serializer.hpp \
|
||||
$(SRCDIR)/detail/json_ref.hpp \
|
||||
$(SRCDIR)/adl_serializer.hpp
|
||||
$(DEVDIR)/json_fwd.hpp \
|
||||
$(DEVDIR)/detail/macro_scope.hpp \
|
||||
$(DEVDIR)/detail/macro_unscope.hpp \
|
||||
$(DEVDIR)/detail/meta.hpp \
|
||||
$(DEVDIR)/detail/exceptions.hpp \
|
||||
$(DEVDIR)/detail/value_t.hpp \
|
||||
$(DEVDIR)/detail/conversions/from_json.hpp \
|
||||
$(DEVDIR)/detail/conversions/to_json.hpp \
|
||||
$(DEVDIR)/detail/parsing/input_adapters.hpp \
|
||||
$(DEVDIR)/detail/parsing/lexer.hpp \
|
||||
$(DEVDIR)/detail/parsing/parser.hpp \
|
||||
$(DEVDIR)/detail/iterators/primitive_iterator.hpp \
|
||||
$(DEVDIR)/detail/iterators/internal_iterator.hpp \
|
||||
$(DEVDIR)/detail/iterators/iter_impl.hpp \
|
||||
$(DEVDIR)/detail/iterators/iteration_proxy.hpp \
|
||||
$(DEVDIR)/detail/iterators/json_reverse_iterator.hpp \
|
||||
$(DEVDIR)/detail/parsing/output_adapters.hpp \
|
||||
$(DEVDIR)/detail/parsing/binary_reader.hpp \
|
||||
$(DEVDIR)/detail/parsing/binary_writer.hpp \
|
||||
$(DEVDIR)/detail/serializer.hpp \
|
||||
$(DEVDIR)/detail/json_ref.hpp \
|
||||
$(DEVDIR)/adl_serializer.hpp
|
||||
|
||||
UNAME = $(shell uname)
|
||||
CXX=clang++
|
||||
|
8024
develop/json.hpp
Normal file
8024
develop/json.hpp
Normal file
File diff suppressed because it is too large
Load Diff
19067
single_header/json.hpp
19067
single_header/json.hpp
File diff suppressed because it is too large
Load Diff
11173
src/json.hpp
11173
src/json.hpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user