mirror of
https://github.com/nlohmann/json.git
synced 2026-09-30 14:05:18 +00:00
The new single header goes through the same checks and install steps as json.hpp and json_fwd.hpp: - cmake/ci.cmake: ci_test_amalgamation regenerates, formats, and compares json_view.hpp as well - check_amalgamation.yml: the pull request check does the same; it runs develop's tools, so it needs config_json_view.json on develop first - meson.build: installs single_include/nlohmann/json_view.hpp - gen_bazel_build_file.cmake, BUILD.bazel: json_view.hpp joins the single-header target; the glob of the other target already covers the new headers - labeler.yml: an "aspect: json_view" label for the header, its detail/view headers, tests, and documentation The CMake install rules for include/ and single_include/, the REUSE catch-all, and Package.swift cover the new files without changes. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
59 lines
1.4 KiB
CMake
59 lines
1.4 KiB
CMake
# generate Bazel BUILD file
|
|
#
|
|
# usage: cmake -P cmake/scripts/gen_bazel_build_file.cmake (or: make BUILD.bazel)
|
|
#
|
|
# The header list of the "json" target is derived from the files in include/. Everything else is fixed text below,
|
|
# so edit this script rather than BUILD.bazel.
|
|
|
|
get_filename_component(PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
|
|
set(BUILD_FILE "${PROJECT_ROOT}/BUILD.bazel")
|
|
|
|
file(GLOB_RECURSE HEADERS LIST_DIRECTORIES false RELATIVE "${PROJECT_ROOT}" "${PROJECT_ROOT}/include/*.hpp")
|
|
list(SORT HEADERS)
|
|
|
|
set(CONTENT [=[
|
|
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 = [
|
|
]=])
|
|
|
|
foreach(header ${HEADERS})
|
|
string(APPEND CONTENT " \"${header}\",\n")
|
|
endforeach()
|
|
|
|
string(APPEND CONTENT [=[
|
|
],
|
|
includes = ["include"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "singleheader-json",
|
|
hdrs = [
|
|
"single_include/nlohmann/json.hpp",
|
|
"single_include/nlohmann/json_view.hpp",
|
|
],
|
|
includes = ["single_include"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
]=])
|
|
|
|
file(WRITE "${BUILD_FILE}" "${CONTENT}")
|