You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 03ec870
Browse filesBrowse the repository at this point in the historyBrowse files
Add USE_VENDORED_JSON option to use the system nlohmann_json (fixes#959) (#1235)
* Add USE_VENDORED_JSON option to use the system nlohmann_json (fixes#959)
BT.CPP bundles nlohmann/json 3.11.3 and its public headers include it
unconditionally. A user that also includes a system nlohmann/json gets two
versions behind the same include guard: whichever comes first wins, and the
result is mismatched types or link errors (#959).
With -DUSE_VENDORED_JSON=OFF the library uses find_package(nlohmann_json 3.10):
- the public headers include <nlohmann/json.hpp> when BTCPP_SYSTEM_JSON is
defined. The library exports that definition together with the
nlohmann_json target (CMake config and ament), so its users see the same
version it was built with;
- the bundled header is not installed: a user that bypasses the CMake target
(plain include dirs, Makefiles, Bazel) fails to compile, instead of
silently mixing two versions;
- the tests get nlohmann::json from the BT.CPP headers, like any user,
instead of including the bundled copy directly.
The default (ON) is unchanged: it needs no new definition and the headers
preprocess to the same code, so the API and ABI are the same.
nlohmann::json is part of the public API, so an OFF build has a different ABI
than the default one: everything linking it must use the same nlohmann_json.
A new CI job builds and tests OFF on Ubuntu 22.04 with apt's nlohmann_json
3.10.5, the oldest supported version.
Supersedes #1080.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* CI: limit the system-json build to nproc jobs
'cmake --build --parallel' without a number runs an unbounded 'make -j' with
the default generator: the runner ran out of memory and was shut down.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments