Skip to content

Commit

Permalink
add external_include_paths feature on windows cpp toolchain
Browse files Browse the repository at this point in the history
Potentially fix #15762 and #15865 (if they depend on windows).

Linked to 08936ae

Closes #16694.

PiperOrigin-RevId: 505084880
Change-Id: Ie4dc08a0e93c76419b6164bacccadac32a7c7b2f
  • Loading branch information
lripoche authored and copybara-github committed Jan 27, 2023
1 parent c99e97a commit 850b334
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tools/cpp/windows_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,32 @@ def _impl(ctx):
],
)

external_include_paths_feature = feature(
name = "external_include_paths",
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.clif_match,
ACTION_NAMES.objc_compile,
ACTION_NAMES.objcpp_compile,
],
flag_groups = [
flag_group(
flags = ["/external:I", "%{external_include_paths}"],
iterate_over = "external_include_paths",
expand_if_available = "external_include_paths",
),
],
),
],
)

linkstamps_feature = feature(
name = "linkstamps",
flag_sets = [
Expand Down Expand Up @@ -1072,6 +1098,7 @@ def _impl(ctx):
msvc_compile_env_feature,
msvc_link_env_feature,
include_paths_feature,
external_include_paths_feature,
preprocessor_defines_feature,
parse_showincludes_feature,
generate_pdb_file_feature,
Expand Down

0 comments on commit 850b334

Please sign in to comment.