JsonCpp provides a script to generate an amalgamated source and header file. This is useful for projects that want to include JsonCpp without adding it as a full dependency or build system integration.
Generating Amalgamated Files
You can generate the amalgamated files by running the following Python script from the top-level directory of the JsonCpp source tree:
python3 amalgamate.py
This will create a dist directory containing:
jsoncpp.cpp: The complete source code.
json/json.h: The complete header file.
json/json-forwards.h: Forward declarations.
Integration
To use the amalgamated source in your project:
- Copy the
dist directory contents into your project's source tree.
- Add
jsoncpp.cpp to your build system's source files.
- Ensure your include paths are set up so that
#include "json/json.h" works.
For more information, see the README.