Skip to content

Commit

Permalink
build: prevent VsDevCmd.bat from changing cwd
Browse files Browse the repository at this point in the history
VsDevCmd.bat changes the current working directory to
"%USERPROFILE%\Source" if it exists. Setting VSCMD_START_DIR overrides
this behavior.

PR-URL: #14303
Fixes: #14300
Refs: https://developercommunity.visualstudio.com/content/problem/26780/vsdevcmdbat-changes-the-current-working-directory.html
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
seishun authored and addaleax committed Jul 18, 2017
1 parent 4587f21 commit 1444601
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_
set "VSINSTALLDIR="
call tools\msvs\vswhere_usability_wrapper.cmd
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
@rem prevent VsDevCmd.bat from changing the current working directory
set "VSCMD_START_DIR=%CD%"
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
echo calling: %vcvars_call%
call %vcvars_call%
Expand Down

0 comments on commit 1444601

Please sign in to comment.