Description
My build.rs builds my native code by invoking msbuild.exe on the Visual Studio solution that normally builds it when it isn't being used with Rust. And, my Visual Studio solution is designed to build correctly with both MSVC 2013 and MSVC 2015.
I've found that Cargo will end up linking with VS 2015's link.exe (tools version 14.0), but that my %PATH% has msbuild 12.0 (VS 2013's) in the path. My build.rs needs to know which version of link.exe is going to be chosen so that it can build the code using the same version of the compiler (Code compiled with MSVC 12.0 cannot be linked with code compiled with MSVC 14.0).
To solve this problem, I propose that Cargo pass CARGO_MSVC_TOOLS_VERSION=12.0 or CARGO_MSVC_TOOLS_VERSION=14.0 in the environment when it runs build.rs based on which version of link.exe it selects.