-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use single-header json implementation.
clang-tidy complains if a symbol is not in a header directly included with the [misc-include-cleaner] check. Since the multi-header does one indirection, this results in these warnings. Using the single-header library helps. Patch upostream bzlmod package to provide that. TODO: check with bzlmod mintainer for nlohmann_json to maybe provide a target for that.
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- BUILD.bazel 2024-09-27 08:43:50.907170239 -0700 | ||
+++ BUILD.bazel 2024-09-27 08:46:27.441297623 -0700 | ||
@@ -1,5 +1,5 @@ | ||
cc_library( | ||
- name = "json", | ||
+ name = "json-multiheader", | ||
hdrs = [ | ||
"include/nlohmann/adl_serializer.hpp", | ||
"include/nlohmann/byte_container_with_subtype.hpp", | ||
@@ -51,3 +51,13 @@ | ||
visibility = ["//visibility:public"], | ||
alwayslink = True, | ||
) | ||
+cc_library( | ||
+ name = "json", | ||
+ hdrs = [ | ||
+ "single_include/nlohmann/json.hpp", | ||
+ ], | ||
+ includes = ["single_include"], | ||
+ visibility = ["//visibility:public"], | ||
+ copts = ["-fexceptions"], | ||
+ features = ["-use_header_modules"], # precompiled headers incompatible with -fexceptions. | ||
+) |