From a53f93193c9721f1f597dab675a73e87330b9c7f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 13 Jun 2024 18:01:27 -0700 Subject: [PATCH] [bazel] Use `includes` instead of `strip_include_prefix` When using `includes`, consumers will apply the headers using `-isystem`, instead of `-I`. This will allow diagnostics of consumers to not apply to `benchmark`. More info: https://bazel.build/reference/be/c-cpp#cc_library.includes https://bazel.build/reference/be/c-cpp#cc_library.strip_include_prefix gtest uses `includes` as well: https://github.com/google/googletest/blob/1d17ea141d2c11b8917d2c7d029f1c4e2b9769b2/BUILD.bazel#L120 --- BUILD.bazel | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index f7a1162baa..cd31663bbd 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -87,7 +87,7 @@ cc_library( "_LARGEFILE64_SOURCE", "_LARGEFILE_SOURCE", ], - strip_include_prefix = "include", + includes = ["include"], visibility = ["//visibility:public"], deps = select({ ":perfcounters": ["@libpfm"], @@ -102,7 +102,7 @@ cc_library( "include/benchmark/benchmark.h", "include/benchmark/export.h", ], - strip_include_prefix = "include", + includes = ["include"], visibility = ["//visibility:public"], deps = [":benchmark"], )