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/flags/BUILD.bazel | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'absl/flags') diff --git a/absl/flags/BUILD.bazel b/absl/flags/BUILD.bazel index 65577a9b..c21fd258 100644 --- a/absl/flags/BUILD.bazel +++ b/absl/flags/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"]) @@ -346,6 +352,7 @@ cc_test( ":reflection", "//absl/memory", "//absl/strings", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -360,6 +367,7 @@ cc_test( linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ ":config", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -391,6 +399,7 @@ cc_test( "//absl/numeric:int128", "//absl/strings", "//absl/time", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -430,6 +439,7 @@ cc_test( linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ ":marshalling", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -458,6 +468,7 @@ cc_test( "//absl/log", "//absl/strings", "//absl/types:span", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -472,6 +483,7 @@ cc_test( linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ ":path_util", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -488,6 +500,7 @@ cc_test( deps = [ ":program_name", "//absl/strings", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -515,6 +528,7 @@ cc_test( ":usage_internal", "//absl/memory", "//absl/strings", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -535,6 +549,7 @@ cc_test( "//absl/base", "//absl/container:fixed_array", "//absl/time", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) @@ -552,6 +567,7 @@ cc_test( ":path_util", ":program_name", "//absl/strings", + "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) -- cgit v1.2.3