mirror of
https://github.com/nlohmann/json.git
synced 2026-10-03 21:20:30 +00:00
Make the json.tar.xz release archive configure standalone
The json.tar.xz rule packed neither src/modules nor tests, but the top-level CMakeLists.txt needs src/modules for NLOHMANN_JSON_BUILD_MODULES=ON and defaulted JSON_BuildTests to ON for a main project. A standalone configure of the extracted archive failed at add_subdirectory(tests), and enabling the module failed at add_subdirectory(src/modules). Add src/modules to the archive, and default JSON_BuildTests to ON only if tests/CMakeLists.txt exists, so a repository checkout still builds the tests by default while the archive configures out of the box. Use GNU tar via a TAR variable (gtar if present, else tar), the same way SED is found, instead of hard-coding gtar. The library, its public API, and its ABI are unchanged. Part of #5716 Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -125,7 +125,7 @@ automatically download a release as a dependency at configure time.
|
||||
|
||||
### `JSON_BuildTests`
|
||||
|
||||
Build the unit tests when [`BUILD_TESTING`](https://cmake.org/cmake/help/latest/command/enable_testing.html) is enabled. This option is `ON` by default if the library's CMake project is the top project. That is, when integrating the library as described above, the test suite is not built unless explicitly switched on with this option.
|
||||
Build the unit tests when [`BUILD_TESTING`](https://cmake.org/cmake/help/latest/command/enable_testing.html) is enabled. This option is `ON` by default if the library's CMake project is the top project and the `tests` directory exists (the release archive `json.tar.xz` does not contain it). That is, when integrating the library as described above, the test suite is not built unless explicitly switched on with this option.
|
||||
|
||||
### `JSON_CI`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user