Skip to content

Commit 1444601

Browse files
seishunaddaleax
authored andcommitted
build: prevent VsDevCmd.bat from changing cwd
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]>
1 parent 4587f21 commit 1444601

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

vcbuild.bat

+2
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_
176176
set "VSINSTALLDIR="
177177
call tools\msvs\vswhere_usability_wrapper.cmd
178178
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
179+
@rem prevent VsDevCmd.bat from changing the current working directory
180+
set "VSCMD_START_DIR=%CD%"
179181
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg%
180182
echo calling: %vcvars_call%
181183
call %vcvars_call%

0 commit comments

Comments
 (0)