From 9398f7bde117e49830a128e7d4b239f010646ee2 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Wed, 11 Oct 2023 09:18:49 -0400 Subject: [PATCH] Bazel: Support header_modules, layering_check and parse_headers The layering_check feature ensures that rules that include a header explicitly depend on a rule that exports that header. Compiler support is required, and currently only Clang 16+ supports diagnoses layering_check failures. The parse_headers feature ensures headers are self-contained by compiling them with -fsyntax-only on supported compilers. The header_modules feature is Bazel support for modules and is already enabled when CCTZ is included in Abseil. This just reduces the BUILD diff. --- BUILD | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BUILD b/BUILD index 277312d..1a07a61 100644 --- a/BUILD +++ b/BUILD @@ -12,6 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +package( + features = [ + "header_modules", + "layering_check", + "parse_headers", + ], +) + licenses(["notice"]) ### libraries @@ -74,6 +82,7 @@ cc_test( srcs = ["src/civil_time_test.cc"], deps = [ ":civil_time", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -85,6 +94,7 @@ cc_test( deps = [ ":civil_time", ":time_zone", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -96,6 +106,7 @@ cc_test( deps = [ ":civil_time", ":time_zone", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], )