➖ ➕ replaces amalgamation tool
The tool used before created a lot of duplicates inside the generated amalgamation. The new tool is a single Python file which seems to do the same job.
This commit is contained in:
parent
0a2920e0fd
commit
ce53537ba2
@ -68,27 +68,6 @@ if(BUILD_TESTING AND JSON_BuildTests)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
##
|
||||
## AMALGAMATION
|
||||
## create a single header file
|
||||
##
|
||||
option(JSON_Amalgamate "Build and use amalgamation" OFF)
|
||||
|
||||
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
|
||||
## install header files, generate and install cmake config files for find_package()
|
||||
|
57
Makefile
57
Makefile
@ -1,30 +1,28 @@
|
||||
.PHONY: pretty clean ChangeLog.md
|
||||
|
||||
SRCDIR = ./src
|
||||
DEVDIR = ./develop
|
||||
SRCS = $(SRCDIR)/json.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
|
||||
SRCS = develop/json.hpp \
|
||||
develop/json_fwd.hpp \
|
||||
develop/detail/macro_scope.hpp \
|
||||
develop/detail/macro_unscope.hpp \
|
||||
develop/detail/meta.hpp \
|
||||
develop/detail/exceptions.hpp \
|
||||
develop/detail/value_t.hpp \
|
||||
develop/detail/conversions/from_json.hpp \
|
||||
develop/detail/conversions/to_json.hpp \
|
||||
develop/detail/parsing/input_adapters.hpp \
|
||||
develop/detail/parsing/lexer.hpp \
|
||||
develop/detail/parsing/parser.hpp \
|
||||
develop/detail/iterators/primitive_iterator.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/parsing/output_adapters.hpp \
|
||||
develop/detail/parsing/binary_reader.hpp \
|
||||
develop/detail/parsing/binary_writer.hpp \
|
||||
develop/detail/serializer.hpp \
|
||||
develop/detail/json_ref.hpp \
|
||||
develop/adl_serializer.hpp
|
||||
|
||||
UNAME = $(shell uname)
|
||||
CXX=clang++
|
||||
@ -247,9 +245,16 @@ 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) test/src/*.cpp \
|
||||
$(SRCS) src/json.hpp test/src/*.cpp \
|
||||
benchmarks/src/benchmarks.cpp doc/examples/*.cpp
|
||||
|
||||
# create single header file
|
||||
amalgamate: src/json.hpp
|
||||
|
||||
src/json.hpp: $(SRCS)
|
||||
develop/amalgamate/amalgamate.py -c develop/amalgamate/config.json -s develop --verbose=yes
|
||||
$(MAKE) pretty
|
||||
|
||||
|
||||
##########################################################################
|
||||
# changelog
|
||||
|
3918
src/json.hpp
3918
src/json.hpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user