corert
corert copied to clipboard
buildvars-setup.cmd will fail because CheckMSBuild used before its defined
buildvars-setup.cmd:156 goto :CheckMSBuild is not working in my environment
a simple fix would be move :MissingVisualC and :CheckMSBuild on top of :VS2017
:MissingVisualC
echo Could not find Visual C++ under !VS%__VSProductVersion%COMNTOOLS!. Visual C++ is a pre-requisite to build this repository.
echo See: https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md
exit /b 1
:CheckMSBuild
if not exist !_msbuildexe! (echo Error: Could not find MSBuild.exe. Please see https://github.com/dotnet/corert/blob/master/Documentation/prerequisites-for-building.md for build instructions. && exit /b 1)
:VS2017
:: Setup vars for VS2017
set __VSVersion=vs2017
set __VSProductVersion=150
if not exist "%VSINSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" goto :MissingVisualC
set _msbuildexe="%VSINSTALLDIR%\MSBuild\15.0\Bin\MSBuild.exe"
goto :CheckMSBuild
:VS2019
:: Setup vars for VS2019
set __VSVersion=vs2019
set __VSProductVersion=160
if not exist "%VSINSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" goto :MissingVisualC
set _msbuildexe="%VSINSTALLDIR%\MSBuild\Current\Bin\MSBuild.exe"
goto :CheckMSBuild
Not sure that the reason this could be failing is because of the order. The following batch is valid:
GOTO END
ECHO SKIPPING THIS
:END
ECHO DONE
Maybe you could post the output of what happens?