diff options
author | Derek Mauro <dmauro@google.com> | 2023-10-10 13:29:16 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-10-10 13:30:24 -0700 |
commit | 143e983739333ce4b30320d26bce8594bd24b5f3 (patch) | |
tree | 84515b81a55d409a170ef99683b4c08766829e6a /absl/log | |
parent | 5dc0e78af1c2781644a350d36ae37f0c21e579fe (diff) |
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
Diffstat (limited to 'absl/log')
-rw-r--r-- | absl/log/BUILD.bazel | 24 | ||||
-rw-r--r-- | absl/log/internal/BUILD.bazel | 14 |
2 files changed, 34 insertions, 4 deletions
diff --git a/absl/log/BUILD.bazel b/absl/log/BUILD.bazel index 2f393554..630cc669 100644 --- a/absl/log/BUILD.bazel +++ b/absl/log/BUILD.bazel @@ -21,7 +21,13 @@ load( "ABSL_TEST_COPTS", ) -package(default_visibility = ["//visibility:public"]) +package( + default_visibility = ["//visibility:public"], + features = [ + "layering_check", + "parse_headers", + ], +) licenses(["notice"]) @@ -244,6 +250,7 @@ cc_test( deps = [ ":absl_check", ":check_test_impl", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -257,6 +264,7 @@ cc_test( deps = [ ":absl_log", ":log_basic_test_impl", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -275,6 +283,7 @@ cc_test( deps = [ ":check", ":check_test_impl", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -310,6 +319,7 @@ cc_test( ":die_if_null", "//absl/base:core_headers", "//absl/log/internal:test_helpers", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -333,6 +343,7 @@ cc_test( "//absl/log/internal:test_helpers", "//absl/log/internal:test_matchers", "//absl/strings", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -351,6 +362,7 @@ cc_test( "//absl/base:log_severity", "//absl/log/internal:globals", "//absl/log/internal:test_helpers", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -364,6 +376,7 @@ cc_test( deps = [ ":log", ":log_basic_test_impl", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -405,6 +418,7 @@ cc_test( "//absl/strings", "//absl/time", "//absl/types:span", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -423,6 +437,7 @@ cc_test( "//absl/strings", "//absl/strings:str_format", "//absl/types:optional", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -438,6 +453,7 @@ cc_test( ":scoped_mock_log", "//absl/base:core_headers", "//absl/base:log_severity", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -463,6 +479,7 @@ cc_test( "//absl/log/internal:test_helpers", "//absl/log/internal:test_matchers", "//absl/strings", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -484,6 +501,7 @@ cc_test( "//absl/log/internal:test_helpers", "//absl/log/internal:test_matchers", "//absl/strings", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -503,6 +521,7 @@ cc_test( "//absl/log/internal:test_matchers", "//absl/strings", "//absl/time", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -530,6 +549,7 @@ cc_test( "//absl/memory", "//absl/strings", "//absl/synchronization", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -552,6 +572,7 @@ cc_test( "//absl/log/internal:test_helpers", "//absl/strings", "//absl/strings:str_format", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -569,6 +590,7 @@ cc_test( "//absl/base:core_headers", "//absl/log/internal:test_helpers", "//absl/log/internal:test_matchers", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) diff --git a/absl/log/internal/BUILD.bazel b/absl/log/internal/BUILD.bazel index d7a30c9e..49d91b3c 100644 --- a/absl/log/internal/BUILD.bazel +++ b/absl/log/internal/BUILD.bazel @@ -21,9 +21,15 @@ load( "ABSL_TEST_COPTS", ) -package(default_visibility = [ - "//absl/log:__pkg__", -]) +package( + default_visibility = [ + "//absl/log:__pkg__", + ], + features = [ + "layering_check", + "parse_headers", + ], +) licenses(["notice"]) @@ -390,6 +396,7 @@ cc_test( "//absl/base:log_severity", "//absl/log", "//absl/log:globals", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -401,6 +408,7 @@ cc_test( linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ ":fnmatch", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) |