[bazel] Use `includes` instead of `strip_include_prefix` (#1803)

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:
1d17ea141d/BUILD.bazel (L120)
This commit is contained in:
Alexander Karatarakis 2024-06-17 01:38:32 -07:00 committed by GitHub
parent 8e1823d6f5
commit 447752540c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -73,6 +73,7 @@ cc_library(
":perfcounters": ["HAVE_LIBPFM"],
"//conditions:default": [],
}),
includes = ["include"],
linkopts = select({
":windows": ["-DEFAULTLIB:shlwapi.lib"],
"//conditions:default": ["-pthread"],
@ -87,7 +88,6 @@ cc_library(
"_LARGEFILE64_SOURCE",
"_LARGEFILE_SOURCE",
],
strip_include_prefix = "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"],
)