mirror of
https://github.com/nlohmann/json.git
synced 2026-09-24 06:10:22 +01:00
The "json" cc_library did not list three headers that the library includes: - detail/meta/logic.hpp (added in #5016, included by from_json.hpp) - detail/input/number_parse.hpp (added in #5283, included by lexer.hpp) - detail/input/string_scan.hpp (added in #5283, included by lexer.hpp and serializer.hpp) Bazel's sandbox only exposes declared headers, so any target depending on @nlohmann_json//:json and including <nlohmann/json.hpp> failed with "'nlohmann/detail/meta/logic.hpp' file not found". The file could not simply be regenerated, because the generator behind "make BUILD.bazel" was stale: it wrote only the "json" cc_library and dropped the load() statements, the license block, and the "singleheader-json" target that were added by hand in #4584. The generator now emits the complete file, so its output differs from the previous BUILD.bazel only by the three headers. It also resolves the glob against the project root instead of the working directory and sorts the list explicitly. "make BUILD.bazel" is now phony: in a fresh checkout, BUILD.bazel is not older than the headers, so make considered it up to date, and a removed header would never trigger a rebuild. "make check-amalgamation" also checks that BUILD.bazel is up to date. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
84 lines
3.3 KiB
Python
84 lines
3.3 KiB
Python
load("@rules_cc//cc:cc_library.bzl", "cc_library")
|
|
load("@rules_license//rules:license.bzl", "license")
|
|
|
|
package(
|
|
default_applicable_licenses = [":license"],
|
|
)
|
|
|
|
exports_files([
|
|
"LICENSE.MIT",
|
|
])
|
|
|
|
license(
|
|
name = "license",
|
|
license_kinds = ["@rules_license//licenses/spdx:MIT"],
|
|
license_text = "LICENSE.MIT",
|
|
)
|
|
|
|
cc_library(
|
|
name = "json",
|
|
hdrs = [
|
|
"include/nlohmann/adl_serializer.hpp",
|
|
"include/nlohmann/byte_container_with_subtype.hpp",
|
|
"include/nlohmann/detail/abi_macros.hpp",
|
|
"include/nlohmann/detail/conversions/from_json.hpp",
|
|
"include/nlohmann/detail/conversions/to_chars.hpp",
|
|
"include/nlohmann/detail/conversions/to_json.hpp",
|
|
"include/nlohmann/detail/exceptions.hpp",
|
|
"include/nlohmann/detail/hash.hpp",
|
|
"include/nlohmann/detail/input/binary_reader.hpp",
|
|
"include/nlohmann/detail/input/input_adapters.hpp",
|
|
"include/nlohmann/detail/input/json_sax.hpp",
|
|
"include/nlohmann/detail/input/lexer.hpp",
|
|
"include/nlohmann/detail/input/number_parse.hpp",
|
|
"include/nlohmann/detail/input/parser.hpp",
|
|
"include/nlohmann/detail/input/position_t.hpp",
|
|
"include/nlohmann/detail/input/string_scan.hpp",
|
|
"include/nlohmann/detail/iterators/internal_iterator.hpp",
|
|
"include/nlohmann/detail/iterators/iter_impl.hpp",
|
|
"include/nlohmann/detail/iterators/iteration_proxy.hpp",
|
|
"include/nlohmann/detail/iterators/iterator_traits.hpp",
|
|
"include/nlohmann/detail/iterators/json_reverse_iterator.hpp",
|
|
"include/nlohmann/detail/iterators/primitive_iterator.hpp",
|
|
"include/nlohmann/detail/json_custom_base_class.hpp",
|
|
"include/nlohmann/detail/json_pointer.hpp",
|
|
"include/nlohmann/detail/json_ref.hpp",
|
|
"include/nlohmann/detail/macro_scope.hpp",
|
|
"include/nlohmann/detail/macro_unscope.hpp",
|
|
"include/nlohmann/detail/meta/call_std/begin.hpp",
|
|
"include/nlohmann/detail/meta/call_std/end.hpp",
|
|
"include/nlohmann/detail/meta/cpp_future.hpp",
|
|
"include/nlohmann/detail/meta/detected.hpp",
|
|
"include/nlohmann/detail/meta/identity_tag.hpp",
|
|
"include/nlohmann/detail/meta/is_sax.hpp",
|
|
"include/nlohmann/detail/meta/logic.hpp",
|
|
"include/nlohmann/detail/meta/std_fs.hpp",
|
|
"include/nlohmann/detail/meta/type_traits.hpp",
|
|
"include/nlohmann/detail/meta/void_t.hpp",
|
|
"include/nlohmann/detail/output/binary_writer.hpp",
|
|
"include/nlohmann/detail/output/output_adapters.hpp",
|
|
"include/nlohmann/detail/output/serializer.hpp",
|
|
"include/nlohmann/detail/string_concat.hpp",
|
|
"include/nlohmann/detail/string_escape.hpp",
|
|
"include/nlohmann/detail/string_utils.hpp",
|
|
"include/nlohmann/detail/value_t.hpp",
|
|
"include/nlohmann/json.hpp",
|
|
"include/nlohmann/json_fwd.hpp",
|
|
"include/nlohmann/ordered_map.hpp",
|
|
"include/nlohmann/thirdparty/hedley/hedley.hpp",
|
|
"include/nlohmann/thirdparty/hedley/hedley_undef.hpp",
|
|
],
|
|
includes = ["include"],
|
|
visibility = ["//visibility:public"],
|
|
alwayslink = True,
|
|
)
|
|
|
|
cc_library(
|
|
name = "singleheader-json",
|
|
hdrs = [
|
|
"single_include/nlohmann/json.hpp",
|
|
],
|
|
includes = ["single_include"],
|
|
visibility = ["//visibility:public"],
|
|
)
|