diff options
author | Loo Rong Jie <loorongjie@gmail.com> | 2018-07-10 00:36:19 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-07-10 00:37:50 -0700 |
commit | e6860a80e92d3372f18a3c6b30c7fdd0d6001e3e (patch) | |
tree | 5a6fe6f4d592386cc63304ec1b368f75af436c48 /tools | |
parent | d92725bd16beafc2a7793aa3086947501b64eb56 (diff) |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cpp/CROSSTOOL.tpl | 41 |
1 files changed, 33 insertions, 8 deletions
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 @@ -492,14 +492,6 @@ toolchain { 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 { |