diff --git a/BUILD.bazel b/BUILD.bazel index 15d84f16b..3ab4b1e78 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,6 +1,6 @@ cc_library( name = "json", - hdrs = [ + srcs = [ "include/nlohmann/adl_serializer.hpp", "include/nlohmann/byte_container_with_subtype.hpp", "include/nlohmann/detail/abi_macros.hpp", @@ -41,12 +41,12 @@ cc_library( "include/nlohmann/detail/string_concat.hpp", "include/nlohmann/detail/string_escape.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", ], + hdrs = ["include/nlohmann/json.hpp"], includes = ["include"], visibility = ["//visibility:public"], alwayslink = True, diff --git a/cmake/scripts/gen_bazel_build_file.cmake b/cmake/scripts/gen_bazel_build_file.cmake index e754d387d..8e4bc96e4 100644 --- a/cmake/scripts/gen_bazel_build_file.cmake +++ b/cmake/scripts/gen_bazel_build_file.cmake @@ -4,11 +4,12 @@ set(PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/../..") set(BUILD_FILE "${PROJECT_ROOT}/BUILD.bazel") file(GLOB_RECURSE HEADERS LIST_DIRECTORIES false RELATIVE "${PROJECT_ROOT}" "include/*.hpp") +list(REMOVE_ITEM HEADERS "include/nlohmann/json.hpp") file(WRITE "${BUILD_FILE}" [=[ cc_library( name = "json", - hdrs = [ + srcs = [ ]=]) foreach(header ${HEADERS}) @@ -17,6 +18,7 @@ endforeach() file(APPEND "${BUILD_FILE}" [=[ ], + hdrs = ["include/nlohmann/json.hpp"], includes = ["include"], visibility = ["//visibility:public"], alwayslink = True,