I have a mono repository containing source code that is divided into several Bazel modules (bzlmod). When I build the C++ code, bazel exclude build warnings from the modules since it consider that code to be external and is hence using -isystem includes for those header files. However, in my case, for all Bazel modules that are defined within the mono repository, I want build warnings enabled. For modules that are not version controlled within the mono repository, I want build warnings to be excluded.
Is this somehow supported by bazel already?
Example:
mono/MODULE.bazel
mono/BUILD.bazel
mono/.bazelrc # common --override_module=module_x=%workspace%/module_x
mono/module_x/MODULE.bazel
mono/module_x/BUILD.bazel # cc_library(name="x", hdrs=[x.hpp"], ...)
mono/module_x/x.hpp
mono/module_x/x.cpp
In the example above, when building @module_x//:x
I want Bazel to include "x.hpp" using -I and NOT -isystem.
However, when building source code from an external module such as @nanopb//...
, I want -isystem to be in use.