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
Closes
@@ -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 {
