Fix gn gen after vcvarsall.bat

If you are using a locally installed toolchain
(DEPOT_TOOLS_WIN_TOOLCHAIN=0) then the behavior of gn gen depended on
whether you had run vcvarsall.bat before running gn gen. That is because
vcvarsall.bat appends to several environment variables, these appended
values are captured by setup_toolchain.py, so running vcvarsall.bat
affects the command line of commands generated by gn gen.

This fixes that by clearing INCLUDE, LIB, and LIBPATH so that gn gen is
hermetic. This was tested with VS 2019.

Bug: 1112456
Change-Id: Ib2388466915d26033937004ddc5ca304f81e5d79
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2333081
Commit-Queue: Dirk Pranke <dpranke@google.com>
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#794331}
GitOrigin-RevId: 5ac63a961b99bba6cd200e10b82cdadd7f0fbb48
1 file changed