Merge pull request #6577 from lukasztomczyk/threadpool-spinwaitconfig
[platform/upstream/coreclr.git] / run.cmd
1 @if "%_echo%" neq "on" echo off
2 setlocal
3
4 if not defined VisualStudioVersion (
5   if defined VS140COMNTOOLS (
6          if not exist "%VS140COMNTOOLS%\..\IDE\devenv.exe"      goto NoVS
7          if not exist "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" goto NoVS
8          if not exist "%VS140COMNTOOLS%\VsDevCmd.bat"                     goto NoVS
9     call "%VS140COMNTOOLS%\VsDevCmd.bat"
10     goto :Run
11   )
12
13   :NoVS
14   echo Error: Visual Studio 2015 required.
15   echo        https://github.com/dotnet/coreclr/blob/master/Documentation/building/windows-instructions.md for build instructions.
16   exit /b 1
17 )
18
19 :Run
20 :: Clear the 'Platform' env variable for this session, as it's a per-project setting within the build, and
21 :: misleading value (such as 'MCD' in HP PCs) may lead to build breakage (issue: #69).
22 set Platform=
23
24 :: Restore the Tools directory
25 call %~dp0init-tools.cmd
26 if NOT [%ERRORLEVEL%]==[0] (
27   exit /b 1
28 )
29
30 set _toolRuntime=%~dp0Tools
31 set _dotnet=%_toolRuntime%\dotnetcli\dotnet.exe
32
33 echo Running: %_dotnet% %_toolRuntime%\run.exe %*
34 call %_dotnet% %_toolRuntime%\run.exe %*
35 if NOT [%ERRORLEVEL%]==[0] (
36   exit /b 1
37 )
38
39 exit /b 0