Skip to content

Commit

Permalink
Don't set msys usr directory as cxx_builtin_include_directories for M…
Browse files Browse the repository at this point in the history
…SVC toolchain

Otherwise, if user's source code is under c:/tools/msys64/usr, include detection will all fail.

RELNOTES: None
PiperOrigin-RevId: 242097798
  • Loading branch information
meteorcloudy authored and copybara-github committed Apr 5, 2019
1 parent 9d3dced commit b137071
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/cpp/cc_toolchain_config.bzl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def _windows_msvc_impl(ctx):
builtin_sysroot = None

cxx_builtin_include_directories = [
%{cxx_builtin_include_directories}
%{msvc_cxx_builtin_include_directories}
]

cpp_link_nodeps_dynamic_library_action = action_config(
Expand Down
1 change: 1 addition & 0 deletions tools/cpp/unix_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
"%{msvc_ml_path}": "",
"%{msvc_link_path}": "",
"%{msvc_lib_path}": "",
"%{msvc_cxx_builtin_include_directories}": "",
"%{msys_x64_mingw_cxx_content}": "",
"%{msys_x64_mingw_link_content}": "",
"%{dbg_mode_debug}": "",
Expand Down
8 changes: 5 additions & 3 deletions tools/cpp/windows_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def configure_windows_toolchain(repository_ctx):
)

tool_paths_mingw, tool_bin_path_mingw, inc_dir_mingw, _ = _get_escaped_windows_msys_starlark_content(repository_ctx, use_mingw = True)
tool_paths, tool_bin_path, inc_dir, artifact_patterns = _get_escaped_windows_msys_starlark_content(repository_ctx)
tool_paths, tool_bin_path, inc_dir_msys, artifact_patterns = _get_escaped_windows_msys_starlark_content(repository_ctx)
if not vc_path or missing_tools:
repository_ctx.template(
"cc_toolchain_config.bzl",
Expand All @@ -377,6 +377,7 @@ def configure_windows_toolchain(repository_ctx):
"%{msvc_ml_path}": "vc_installation_error.bat",
"%{msvc_link_path}": "vc_installation_error.bat",
"%{msvc_lib_path}": "vc_installation_error.bat",
"%{msvc_cxx_builtin_include_directories}": "",
"%{msys_x64_mingw_cxx_content}": get_starlark_list(["-std=gnu++0x"]),
"%{msys_x64_mingw_link_content}": get_starlark_list(["-lstdc++"]),
"%{dbg_mode_debug}": "/DEBUG",
Expand All @@ -388,7 +389,7 @@ def configure_windows_toolchain(repository_ctx):
"%{opt_link_content}": "",
"%{unfiltered_content}": "",
"%{dbg_compile_content}": "",
"%{cxx_builtin_include_directories}": inc_dir,
"%{cxx_builtin_include_directories}": inc_dir_msys,
"%{mingw_cxx_builtin_include_directories}": inc_dir_mingw,
"%{coverage_feature}": "",
"%{use_coverage_feature}": "",
Expand Down Expand Up @@ -477,7 +478,8 @@ def configure_windows_toolchain(repository_ctx):
"%{opt_link_content}": "",
"%{unfiltered_content}": "",
"%{dbg_compile_content}": "",
"%{cxx_builtin_include_directories}": inc_dir + ",\n ".join(escaped_cxx_include_directories),
"%{cxx_builtin_include_directories}": inc_dir_msys + ",\n ".join(escaped_cxx_include_directories),
"%{msvc_cxx_builtin_include_directories}": " " + ",\n ".join(escaped_cxx_include_directories),
"%{mingw_cxx_builtin_include_directories}": inc_dir_mingw + ",\n ".join(escaped_cxx_include_directories),
"%{coverage_feature}": "",
"%{use_coverage_feature}": "",
Expand Down

0 comments on commit b137071

Please sign in to comment.