From 4a658b8fe552d71ed022283cc40c2b5673ca98e0 Mon Sep 17 00:00:00 2001 From: lripoche Date: Fri, 27 Jan 2023 04:32:23 -0800 Subject: [PATCH] add external_include_paths feature on windows cpp toolchain Potentially fix #15762 and #15865 (if they depend on windows). Linked to 08936aecb96f2937c61bdedfebcf1c5a41a0786d Closes #16694. PiperOrigin-RevId: 505084880 Change-Id: Ie4dc08a0e93c76419b6164bacccadac32a7c7b2f --- tools/cpp/windows_cc_toolchain_config.bzl | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tools/cpp/windows_cc_toolchain_config.bzl b/tools/cpp/windows_cc_toolchain_config.bzl index eb315f3e821074..11404411fd67dc 100644 --- a/tools/cpp/windows_cc_toolchain_config.bzl +++ b/tools/cpp/windows_cc_toolchain_config.bzl @@ -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 = [ @@ -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,