From 143e983739333ce4b30320d26bce8594bd24b5f3 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Tue, 10 Oct 2023 13:29:16 -0700 Subject: Bazel: Support 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. PiperOrigin-RevId: 572350144 Change-Id: I37297f761566d686d9dd58d318979d688b7e36d1 --- absl/synchronization/BUILD.bazel | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'absl/synchronization/BUILD.bazel') diff --git a/absl/synchronization/BUILD.bazel b/absl/synchronization/BUILD.bazel index 0ca94e01..f26e2b3e 100644 --- a/absl/synchronization/BUILD.bazel +++ b/absl/synchronization/BUILD.bazel @@ -21,7 +21,13 @@ load( "ABSL_TEST_COPTS", ) -package(default_visibility = ["//visibility:private"]) +package( + default_visibility = ["//visibility:private"], + features = [ + "layering_check", + "parse_headers", + ], +) licenses(["notice"]) @@ -76,6 +82,7 @@ cc_test( "//absl/base:config", "//absl/random", "//absl/time", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -151,6 +158,7 @@ cc_test( deps = [ ":synchronization", "//absl/time", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -167,6 +175,7 @@ cc_test( deps = [ ":synchronization", "//absl/time", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -196,6 +205,7 @@ cc_test( "//absl/base:core_headers", "//absl/log", "//absl/log:check", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -212,6 +222,7 @@ cc_test( ":graphcycles_internal", "//absl/base:raw_logging_internal", "@com_github_google_benchmark//:benchmark_main", + "@com_google_googletest//:gtest", ], ) @@ -248,6 +259,7 @@ cc_test( "//absl/log:check", "//absl/memory", "//absl/time", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -260,6 +272,7 @@ cc_test( deps = [ ":synchronization", "//absl/base:config", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -303,6 +316,7 @@ cc_test( deps = [ ":synchronization", "//absl/time", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -356,6 +370,7 @@ cc_test( "//absl/base:config", "//absl/random", "//absl/time", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) -- cgit v1.2.3