bazel icon indicating copy to clipboard operation
bazel copied to clipboard

feat(cc toolchain): support external_include_paths on macos

Open jungleraptor opened this issue 1 year ago • 4 comments

The external_include_paths feature enables specifying include paths locally with -I and with -isystem when the project is included as an external repo.

This makes it possible to set -Werror against your own headers for development without propagating this to consumers of your libraries.

For some reason this was only previously enabled on linux. I do not see a reason for not also enabling it on macos.

jungleraptor avatar Apr 09 '24 22:04 jungleraptor

Cc @keith

fmeum avatar Apr 26 '24 19:04 fmeum

interesting. this doesn't exist in the apple_support toolchain today either. what ends up propagating things as external headers?

keith avatar Apr 26 '24 21:04 keith

interesting. this doesn't exist in the apple_support toolchain today either. what ends up propagating things as external headers?

It works with strip_include_prefix and friends.

So you use that^ to specify include paths and locally they get compiled with -I and - when that feature is enabled in a consuming repo - they get compiled with -isystem.

Using the includes attribute only sets -isystem by default which ignores whatever compiler/linter warnings you've set up.

jungleraptor avatar Apr 26 '24 21:04 jungleraptor

also added this here: https://github.com/bazelbuild/apple_support/pull/327

keith avatar May 06 '24 22:05 keith

@bazel-io flag

brentleyjones avatar May 16 '24 15:05 brentleyjones

@bazel-io fork 7.2.0

keertk avatar May 16 '24 16:05 keertk