mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-26 18:51:04 +08:00
Move amalgamated source details to wiki
This commit is contained in:
parent
c668af9d41
commit
d40f26d472
49
README.md
49
README.md
@ -28,47 +28,6 @@ format to store user input files.
|
|||||||
* `0.y.z` can be used with older compilers.
|
* `0.y.z` can be used with older compilers.
|
||||||
* Major versions maintain binary-compatibility.
|
* Major versions maintain binary-compatibility.
|
||||||
|
|
||||||
|
|
||||||
## Using JsonCpp in your project
|
|
||||||
|
|
||||||
The recommended approach to integrating JsonCpp in your project is to include
|
|
||||||
the [amalgamated source](#generating-amalgamated-source-and-header) (a single
|
|
||||||
`.cpp` file and two `.h` files) in your project, and compile and build as you
|
|
||||||
would any other source file. This ensures consistency of compilation flags and
|
|
||||||
ABI compatibility, issues which arise when building shared or static
|
|
||||||
libraries. See the next section for instructions.
|
|
||||||
|
|
||||||
The `include/` should be added to your compiler include path. JsonCpp headers
|
|
||||||
should be included as follow:
|
|
||||||
|
|
||||||
#include <json/json.h>
|
|
||||||
|
|
||||||
If JsonCpp was built as a dynamic library on Windows, then your project needs to define the macro `JSON_DLL`.
|
|
||||||
|
|
||||||
### Generating amalgamated source and header
|
|
||||||
|
|
||||||
JsonCpp is provided with a script to generate a single header and a single
|
|
||||||
source file to ease inclusion into an existing project. The amalgamated source
|
|
||||||
can be generated at any time by running the following command from the
|
|
||||||
top-directory (this requires Python 2.6):
|
|
||||||
|
|
||||||
python amalgamate.py
|
|
||||||
|
|
||||||
It is possible to specify header name. See the `-h` option for detail.
|
|
||||||
|
|
||||||
By default, the following files are generated:
|
|
||||||
|
|
||||||
* `dist/jsoncpp.cpp`: source file that needs to be added to your project.
|
|
||||||
* `dist/json/json.h`: corresponding header file for use in your project. It is
|
|
||||||
equivalent to including `json/json.h` in non-amalgamated source. This header
|
|
||||||
only depends on standard headers.
|
|
||||||
* `dist/json/json-forwards.h`: header that provides forward declaration of all
|
|
||||||
JsonCpp types.
|
|
||||||
|
|
||||||
The amalgamated sources are generated by concatenating JsonCpp source in the
|
|
||||||
correct order and defining the macro `JSON_IS_AMALGAMATION` to prevent inclusion of other headers.
|
|
||||||
|
|
||||||
|
|
||||||
## Contributing to JsonCpp
|
## Contributing to JsonCpp
|
||||||
|
|
||||||
### Building and testing with Meson/Ninja
|
### Building and testing with Meson/Ninja
|
||||||
@ -158,6 +117,14 @@ When a test is run, output files are generated beside the input test files. Belo
|
|||||||
* `test_complex_01.process-output`: `jsontest` output, typically useful for
|
* `test_complex_01.process-output`: `jsontest` output, typically useful for
|
||||||
understanding parsing errors.
|
understanding parsing errors.
|
||||||
|
|
||||||
|
## Using JsonCpp in your project
|
||||||
|
|
||||||
|
### Amalgamated source
|
||||||
|
https://github.com/open-source-parsers/jsoncpp/wiki/Amalgamated
|
||||||
|
|
||||||
|
### Other ways
|
||||||
|
If you have trouble, see the Wiki, or post a question as an Issue.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
See the `LICENSE` file for details. In summary, JsonCpp is licensed under the
|
See the `LICENSE` file for details. In summary, JsonCpp is licensed under the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user