From 33ef25099d9030167ef568e67ad50178a8d71dbe Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Mon, 28 Sep 2026 20:22:32 +0200 Subject: [PATCH] Keep external headers as #include when amalgamating A header that builds on json.hpp (such as the planned json_view.hpp) must not inline json.hpp: its single-header version would contain a second copy of the library, and that copy would change with every library change. The optional config key "external" lists include paths that are kept as #include directives. Only the first directive per path is kept; repeated ones are commented out, as the tool already does for inlined headers. config_json_view.json uses it for json_view.hpp; the existing configs do not set it, and json.hpp and json_fwd.hpp regenerate byte-identically. Signed-off-by: Niels Lohmann --- tools/amalgamate/CHANGES.md | 3 +++ tools/amalgamate/README.md | 5 +++++ tools/amalgamate/amalgamate.py | 28 +++++++++++++++++++++----- tools/amalgamate/config_json_view.json | 9 +++++++++ 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 tools/amalgamate/config_json_view.json diff --git a/tools/amalgamate/CHANGES.md b/tools/amalgamate/CHANGES.md index 728b93319..684a62148 100644 --- a/tools/amalgamate/CHANGES.md +++ b/tools/amalgamate/CHANGES.md @@ -8,3 +8,6 @@ The following changes have been made to the code with respect to