DescriptionAllow building with VS 2017 when VS 2013/2015 are in path
The VS 2017 vcvarsall.bat file is quite fragile. It fails if
vcvarsall.bat from a previous release has been run in the same command
prompt, and this failure is not detected by setup_toolchain.py. The
problem occurs because the new vcvarsall.bat won't overwrite an
existing VSINSTALLDIR. The fix is to clear it from the environment if it
is set.
The main test was to try to build with VS 2017 after running the VS 2015
vcvarsall.bat. Trimmed output is shown here:
> where cl
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\cl.exe
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe
> set gyp
GYP_MSVS_VERSION=2017
> gn clean out\release & gn gen out\release & ninja -v -C out\release ..\..\build\precompile.cc^^
Done. Made 5496 targets from 1254 files in 4078ms
ninja: Entering directory `out\release'
...
[15/15 0.439s] ... \Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64/cl.exe ...
I also verified that I can switch between 2015 and 2017 builds with just
a "gn gen" to reset the toolchain.
> set GYP_MSVS_VERSION=2015
> gn gen out\release
> ninja -v -C out\release ..\..\build\precompile.cc^^
ninja: Entering directory `out\release'
[1/1 0.140s ] ... "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64/cl.exe" ...
> set GYP_MSVS_VERSION=2017
> gn gen out\release
Done. Made 5496 targets from 1254 files in 3768ms
> ninja -v -C out\release ..\..\build\precompile.cc^^
ninja: Entering directory `out\release'
[1/1 0.131s ] ... \Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64/cl.exe ...
R=scottmg@chromium.org
BUG=683729
Review-Url: https://codereview.chromium.org/2738993003
Cr-Commit-Position: refs/heads/master@{#455630}
Committed: https://chromium.googlesource.com/chromium/src/+/1d57799fb3aa77b04cc79982dca0261d6b7d673e
Patch Set 1 #
Messages
Total messages: 8 (4 generated)
|