Skip to content

Commit b92fac5

Browse files
ahladikaothms
authored andcommitted
Update vs-cfg.cmd
1 parent 824f09a commit b92fac5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

win/vs-cfg.cmd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ set LAST_GENERATOR_IDX=4
5151
set GEN_SHORTHAND=!GENERATOR:vs=!
5252

5353
if not "!GEN_SHORTHAND!"=="" if !GEN_SHORTHAND!==!GENERATOR! goto :GeneratorShorthandCheckDone
54-
set VS_PLATFORM=Win32
54+
55+
set "VS_PLATFORM=Win32"
56+
:: use the command prompt target platform, at least initially
57+
if %VSCMD_ARG_TGT_ARCH%==x86 set "VS_PLATFORM=Win32"
58+
if %VSCMD_ARG_TGT_ARCH%==x64 set "VS_PLATFORM=x64"
59+
if %VSCMD_ARG_TGT_ARCH%==arm set "VS_PLATFORM=ARM"
60+
if %VSCMD_ARG_TGT_ARCH%==arm64 set "VS_PLATFORM=ARM64"
61+
5562
:: "echo if" trick from http://stackoverflow.com/a/8758579
5663
echo(!GEN_SHORTHAND! | findstr /c:"-x86" >nul && ( set "VS_PLATFORM=Win32" )
5764
echo(!GEN_SHORTHAND! | findstr /c:"-x64" >nul && ( set "VS_PLATFORM=x64" )

0 commit comments

Comments
 (0)