Skip to content

Commit 215dbcb

Browse files
authored
[bazel] Enable header processing for C++ builds. (#138934)
This would only work for projects that explicitly enable "parse_headers" feature (or for builds that specify this on command-line) - right now there are none, so this change shouldn't affect most builds. When "parse_headers" is enabled though, it would catch problems of incorrect/missing includes in header-only cc_libraries. See https://bazel.build/docs/bazel-and-cpp#toolchain-features on why this option is a best practice for C++ projects.
1 parent 2852136 commit 215dbcb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

utils/bazel/.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ build --experimental_cc_shared_library
5858
# https://github.com/bazelbuild/bazel/commit/03246077f948f2790a83520e7dccc2625650e6df
5959
build --build_runfile_links=false
6060

61+
# Enable header processing to verify that header-only libraries are
62+
# self-contained (for sub-projects that enable "parse_headers" feature).
63+
# See https://bazel.build/docs/bazel-and-cpp#toolchain-features
64+
build --process_headers_in_dependencies
65+
6166
###############################################################################
6267
# Options to select different strategies for linking potential dependent
6368
# libraries. The default leaves it disabled.

0 commit comments

Comments
 (0)