From e6860a80e92d3372f18a3c6b30c7fdd0d6001e3e Mon Sep 17 00:00:00 2001 From: Loo Rong Jie Date: Tue, 10 Jul 2018 00:36:19 -0700 Subject: Set INCLUDE and LIB env var for actions that actually need them This makes console output of `bazel build -s` shorter when debugging `CROSSTOOL`. /cc @meteorcloudy Closes #5539. PiperOrigin-RevId: 203899866 --- tools/cpp/CROSSTOOL.tpl | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) (limited to 'tools') diff --git a/tools/cpp/CROSSTOOL.tpl b/tools/cpp/CROSSTOOL.tpl index 2460b33d39..0a4b94013f 100644 --- a/tools/cpp/CROSSTOOL.tpl +++ b/tools/cpp/CROSSTOOL.tpl @@ -491,14 +491,6 @@ toolchain { key: "PATH" value: "%{msvc_env_path}" } - env_entry { - key: "INCLUDE" - value: "%{msvc_env_include}" - } - env_entry { - key: "LIB" - value: "%{msvc_env_lib}" - } env_entry { key: "TMP" value: "%{msvc_env_tmp}" @@ -508,6 +500,39 @@ toolchain { value: "%{msvc_env_tmp}" } } + implies: 'msvc_compile_env' + implies: 'msvc_link_env' + } + + feature { + name: "msvc_compile_env" + env_set { + action: "c-compile" + action: "c++-compile" + action: "c++-module-compile" + action: "c++-module-codegen" + action: "c++-header-parsing" + action: "assemble" + action: "preprocess-assemble" + env_entry { + key: "INCLUDE" + value: "%{msvc_env_include}" + } + } + } + + feature { + name: "msvc_link_env" + env_set { + action: "c++-link-executable" + action: "c++-link-dynamic-library" + action: "c++-link-nodeps-dynamic-library" + action: "c++-link-static-library" + env_entry { + key: "LIB" + value: "%{msvc_env_lib}" + } + } } feature { -- cgit v1.2.3