1 @if not defined _echo @echo off
2 setlocal EnableDelayedExpansion EnableExtensions
4 :: Define a prefix for most output progress messages that come from this script. That makes
5 :: it easier to see where these are coming from. Note that there is a trailing space here.
6 set "__MsgPrefix=BUILD: "
8 echo %__MsgPrefix%Starting Build at %TIME%
9 set __ThisScriptFull="%~f0"
10 set __ThisScriptDir="%~dp0"
12 call "%__ThisScriptDir%"\setup_vs_tools.cmd
13 if NOT '%ERRORLEVEL%' == '0' exit /b 1
15 if defined VS150COMNTOOLS (
16 set "__VSToolsRoot=%VS150COMNTOOLS%"
17 set "__VCToolsRoot=%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build"
18 set __VSVersion=vs2017
20 set "__VSToolsRoot=%VS140COMNTOOLS%"
21 set "__VCToolsRoot=%VS140COMNTOOLS%\..\..\VC"
22 set __VSVersion=vs2015
25 :: Note that the msbuild project files (specifically, dir.proj) will use the following variables, if set:
26 :: __BuildArch -- default: x64
27 :: __BuildType -- default: Debug
28 :: __BuildOS -- default: Windows_NT
29 :: __ProjectDir -- default: directory of the dir.props file
30 :: __SourceDir -- default: %__ProjectDir%\src\
31 :: __PackagesDir -- default: %__ProjectDir%\packages\
32 :: __RootBinDir -- default: %__ProjectDir%\bin\
33 :: __BinDir -- default: %__RootBinDir%\%__BuildOS%.%__BuildArch.%__BuildType%\
35 :: __PackagesBinDir -- default: %__BinDir%\.nuget
36 :: __TestWorkingDir -- default: %__RootBinDir%\tests\%__BuildOS%.%__BuildArch.%__BuildType%\
38 :: Thus, these variables are not simply internal to this script!
40 :: Set the default arguments for build
43 set __BuildOS=Windows_NT
45 :: Set the various build properties here so that CMake and MSBuild can pick them up
46 set "__ProjectDir=%~dp0"
47 :: remove trailing slash
48 if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
49 set "__ProjectFilesDir=%__ProjectDir%"
50 set "__SourceDir=%__ProjectDir%\src"
51 set "__PackagesDir=%DotNetRestorePackagesPath%"
52 if [%__PackagesDir%]==[] set "__PackagesDir=%__ProjectDir%\packages"
53 set "__RootBinDir=%__ProjectDir%\bin"
54 set "__LogsDir=%__RootBinDir%\Logs"
55 set "__PgoOptDataVersion="
56 set "__IbcOptDataVersion="
63 set __BuildArchArm64=0
65 set __BuildTypeDebug=0
66 set __BuildTypeChecked=0
67 set __BuildTypeRelease=0
74 REM __PassThroughArgs is a set of things that will be passed through to nested calls to build.cmd
76 set __PassThroughArgs=
78 REM __UnprocessedBuildArgs are args that we pass to msbuild (e.g. /p:__BuildArch=x64)
81 set __UnprocessedBuildArgs=
89 set __BuildNativeCoreLib=1
90 set __RestoreOptData=1
91 set __GenerateLayout=0
94 @REM CMD has a nasty habit of eating "=" on the argument list, so passing:
96 @REM appears to CMD parsing as "-priority 1". Handle -priority specially to avoid problems,
97 @REM and allow the "-priority=1" syntax.
101 if "%1" == "" goto ArgsDone
103 if /i "%1" == "-?" goto Usage
104 if /i "%1" == "-h" goto Usage
105 if /i "%1" == "-help" goto Usage
106 if /i "%1" == "--help" goto Usage
109 if /i "%1" == "-all" (set __BuildAll=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
110 if /i "%1" == "-x64" (set __BuildArchX64=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
111 if /i "%1" == "-x86" (set __BuildArchX86=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
112 if /i "%1" == "-arm" (set __BuildArchArm=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
113 if /i "%1" == "-arm64" (set __BuildArchArm64=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
115 if /i "%1" == "-debug" (set __BuildTypeDebug=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
116 if /i "%1" == "-checked" (set __BuildTypeChecked=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
117 if /i "%1" == "-release" (set __BuildTypeRelease=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
119 REM TODO these are deprecated remove them eventually
120 REM don't add more, use the - syntax instead
121 if /i "%1" == "all" (set __BuildAll=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
122 if /i "%1" == "x64" (set __BuildArchX64=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
123 if /i "%1" == "x86" (set __BuildArchX86=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
124 if /i "%1" == "arm" (set __BuildArchArm=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
125 if /i "%1" == "arm64" (set __BuildArchArm64=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
127 if /i "%1" == "debug" (set __BuildTypeDebug=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
128 if /i "%1" == "checked" (set __BuildTypeChecked=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
129 if /i "%1" == "release" (set __BuildTypeRelease=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
131 if /i "%1" == "-priority" (set __Priority=%2&shift&set processedArgs=!processedArgs! %1=%2&shift&goto Arg_Loop)
133 REM All arguments after this point will be passed through directly to build.cmd on nested invocations
134 REM using the "all" argument, and must be added to the __PassThroughArgs variable.
135 if [!__PassThroughArgs!]==[] (
136 set __PassThroughArgs=%1
138 set __PassThroughArgs=%__PassThroughArgs% %1
141 if /i "%1" == "-freebsdmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=FreeBSD&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
142 if /i "%1" == "-linuxmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=Linux&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
143 if /i "%1" == "-netbsdmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=NetBSD&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
144 if /i "%1" == "-osxmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=OSX&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
145 if /i "%1" == "-windowsmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=Windows_NT&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
146 if /i "%1" == "-nativemscorlib" (set __BuildNativeCoreLib=1&set __BuildCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
147 if /i "%1" == "-configureonly" (set __ConfigureOnly=1&set __BuildNative=1&set __BuildNativeCoreLib=0&set __BuildCoreLib=0&set __BuildTests=0&set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
148 if /i "%1" == "-skipconfigure" (set __SkipConfigure=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
149 if /i "%1" == "-skipmscorlib" (set __BuildCoreLib=0&set __BuildNativeCoreLib=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
150 if /i "%1" == "-skipnative" (set __BuildNative=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
151 if /i "%1" == "-skiptests" (set __BuildTests=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
152 if /i "%1" == "-skipbuildpackages" (set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
153 if /i "%1" == "-skiprestoreoptdata" (set __RestoreOptData=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
154 if /i "%1" == "-usenmakemakefiles" (set __NMakeMakefiles=1&set __ConfigureOnly=1&set __BuildNative=1&set __BuildNativeCoreLib=0&set __BuildCoreLib=0&set __BuildTests=0&set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
155 if /i "%1" == "-pgoinstrument" (set __PgoInstrument=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
156 if /i "%1" == "-enforcepgo" (set __EnforcePgo=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
157 if /i "%1" == "-nopgooptimize" (set __PgoOptimize=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
158 if /i "%1" == "-ibcinstrument" (set __IbcTuning=/Tuning&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
159 if /i "%1" == "-toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
160 if /i "%1" == "-crossgenaltjit" (set __CrossgenAltJit=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
162 REM TODO these are deprecated remove them eventually
163 REM don't add more, use the - syntax instead
164 if /i "%1" == "freebsdmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=FreeBSD&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
165 if /i "%1" == "linuxmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=Linux&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
166 if /i "%1" == "netbsdmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=NetBSD&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
167 if /i "%1" == "osxmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=OSX&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
168 if /i "%1" == "windowsmscorlib" (set __BuildSOS=0&set __BuildNativeCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set __BuildOS=Windows_NT&set __SkipNugetPackage=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
169 if /i "%1" == "nativemscorlib" (set __BuildNativeCoreLib=1&set __BuildCoreLib=0&set __BuildNative=0&set __BuildTests=0&set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
170 if /i "%1" == "configureonly" (set __ConfigureOnly=1&set __BuildNative=1&set __BuildNativeCoreLib=0&set __BuildCoreLib=0&set __BuildTests=0&set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
171 if /i "%1" == "skipconfigure" (set __SkipConfigure=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
172 if /i "%1" == "skipmscorlib" (set __BuildCoreLib=0&set __BuildNativeCoreLib=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
173 if /i "%1" == "skipnative" (set __BuildNative=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
174 if /i "%1" == "skiptests" (set __BuildTests=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
175 if /i "%1" == "skipbuildpackages" (set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
176 if /i "%1" == "skiprestoreoptdata" (set __RestoreOptData=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
177 if /i "%1" == "generatelayout" (set __GenerateLayout=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
178 if /i "%1" == "usenmakemakefiles" (set __NMakeMakefiles=1&set __ConfigureOnly=1&set __BuildNative=1&set __BuildNativeCoreLib=0&set __BuildCoreLib=0&set __BuildTests=0&set __BuildPackages=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
179 if /i "%1" == "pgoinstrument" (set __PgoInstrument=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
180 if /i "%1" == "nopgooptimize" (set __PgoOptimize=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
181 if /i "%1" == "enforcepgo" (set __EnforcePgo=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
182 if /i "%1" == "ibcinstrument" (set __IbcTuning=/Tuning&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
183 if /i "%1" == "toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
185 if [!processedArgs!]==[] (
186 set __UnprocessedBuildArgs=%__args%
188 set __UnprocessedBuildArgs=%__args%
189 for %%t in (!processedArgs!) do (
190 set __UnprocessedBuildArgs=!__UnprocessedBuildArgs:*%%t=!
196 @REM Special handling for -priority=N argument.
197 if defined __Priority (
198 if defined __PassThroughArgs (
199 set __PassThroughArgs=%__PassThroughArgs% -priority=%__Priority%
201 set __PassThroughArgs=-priority=%__Priority%
203 set __UnprocessedBuildArgs=!__UnprocessedBuildArgs! -priority=%__Priority%
206 if %__PgoOptimize%==0 set __RestoreOptData=0
208 if defined __BuildAll goto BuildAll
210 set /A __TotalSpecifiedBuildArch=__BuildArchX64 + __BuildArchX86 + __BuildArchArm + __BuildArchArm64
211 if %__TotalSpecifiedBuildArch% GTR 1 (
212 echo Error: more than one build architecture specified, but "all" not specified.
216 if %__BuildArchX64%==1 set __BuildArch=x64
217 if %__BuildArchX86%==1 set __BuildArch=x86
218 if %__BuildArchArm%==1 (
222 if %__BuildArchArm64%==1 (
223 set __BuildArch=arm64
227 set /A __TotalSpecifiedBuildType=__BuildTypeDebug + __BuildTypeChecked + __BuildTypeRelease
228 if %__TotalSpecifiedBuildType% GTR 1 (
229 echo Error: more than one build type specified, but "all" not specified.
233 if %__BuildTypeDebug%==1 set __BuildType=Debug
234 if %__BuildTypeChecked%==1 set __BuildType=Checked
235 if %__BuildTypeRelease%==1 set __BuildType=Release
237 set __RunArgs=-BuildOS=%__BuildOS% -BuildType=%__BuildType% -BuildArch=%__BuildArch%
239 if %__EnforcePgo%==1 (
240 if %__BuildArchArm%==1 (
241 echo NOTICE: enforcepgo does nothing on arm architecture
243 if %__BuildArchArm64%==1 (
244 echo NOTICE: enforcepgo does nothing on arm64 architecture
248 REM Determine if this is a cross-arch build
250 if /i "%__BuildArch%"=="arm64" (
251 set __DoCrossArchBuild=1
254 if /i "%__BuildArch%"=="arm" (
255 set __DoCrossArchBuild=1
258 :: Set the remaining variables based upon the determined build configuration
259 set "__BinDir=%__RootBinDir%\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
260 set "__IntermediatesDir=%__RootBinDir%\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
261 if "%__NMakeMakefiles%"=="1" (set "__IntermediatesDir=%__RootBinDir%\nmakeobj\%__BuildOS%.%__BuildArch%.%__BuildType%")
262 set "__PackagesBinDir=%__BinDir%\.nuget"
263 set "__TestRootDir=%__RootBinDir%\tests"
264 set "__TestBinDir=%__TestRootDir%\%__BuildOS%.%__BuildArch%.%__BuildType%"
265 set "__TestIntermediatesDir=%__RootBinDir%\tests\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
266 set "__CrossComponentBinDir=%__BinDir%"
267 set "__CrossCompIntermediatesDir=%__IntermediatesDir%\crossgen"
270 if NOT "%__CrossArch%" == "" set __CrossComponentBinDir=%__CrossComponentBinDir%\%__CrossArch%
271 set "__CrossGenCoreLibLog=%__LogsDir%\CrossgenCoreLib_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
272 set "__CrossgenExe=%__CrossComponentBinDir%\crossgen.exe"
274 :: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash
275 set "__CMakeBinDir=%__BinDir%"
276 set "__CMakeBinDir=%__CMakeBinDir:\=/%"
278 if not exist "%__BinDir%" md "%__BinDir%"
279 if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
280 if not exist "%__LogsDir%" md "%__LogsDir%"
282 REM It is convenient to have your Nuget search path include the location where the build
283 REM will place packages. However nuget used during the build will fail if that directory
284 REM does not exist. Avoid this in at least one case by aggressively creating the directory.
285 if not exist "%__BinDir%\.nuget\pkg" md "%__BinDir%\.nuget\pkg"
287 echo %__MsgPrefix%Commencing CoreCLR Repo build
289 :: Set the remaining variables based upon the determined build configuration
291 echo %__MsgPrefix%Checking prerequisites
292 :: Eval the output from probe-win1.ps1
293 for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\pal\tools\probe-win.ps1"""') do %%a
295 REM NumberOfCores is an WMI property providing number of physical cores on machine
296 REM processor(s). It is used to set optimal level of CL parallelism during native build step
297 if not defined NumberOfCores (
298 REM Determine number of physical processor cores available on machine
299 for /f "tokens=*" %%I in (
300 'wmic cpu get NumberOfCores /value ^| find "=" 2^>NUL'
303 echo %__MsgPrefix%Number of processor cores %NumberOfCores%
305 REM =========================================================================================
307 REM === Start the build steps
309 REM =========================================================================================
311 @if defined _echo @echo on
313 @call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\build.proj -generateHeaderWindows -NativeVersionHeaderFile="%__RootBinDir%\obj\_version.h" %__RunArgs% %__UnprocessedBuildArgs%
315 REM =========================================================================================
317 REM === Restore optimization profile data
319 REM =========================================================================================
321 if %__RestoreOptData% EQU 1 if %__BuildTypeRelease% EQU 1 (
322 echo %__MsgPrefix%Restoring the OptimizationData Package
323 @call %__ProjectDir%\run.cmd sync -optdata %__UnprocessedBuildArgs%
324 if not !errorlevel! == 0 (
325 echo %__MsgPrefix%Error: Failed to restore the optimization data package.
330 REM Parse the optdata package versions out of msbuild so that we can pass them on to CMake
331 set DotNetCli=%__ProjectDir%\Tools\dotnetcli\dotnet.exe
332 if not exist "%DotNetCli%" (
333 echo %__MsgPrefix%Assertion failed: dotnet.exe not found at path "%DotNetCli%"
336 set OptDataProjectFilePath=%__ProjectDir%\src\.nuget\optdata\optdata.csproj
337 for /f "tokens=*" %%s in ('%DotNetCli% msbuild "%OptDataProjectFilePath%" /t:DumpPgoDataPackageVersion /nologo') do @(
338 set __PgoOptDataVersion=%%s
340 for /f "tokens=*" %%s in ('%DotNetCli% msbuild "%OptDataProjectFilePath%" /t:DumpIbcDataPackageVersion /nologo') do @(
341 set __IbcOptDataVersion=%%s
344 REM =========================================================================================
346 REM === Generate source files for eventing
348 REM =========================================================================================
350 set __IntermediatesIncDir=%__IntermediatesDir%\src\inc
351 set __IntermediatesEventingDir=%__IntermediatesDir%\eventing
353 REM Find python and set it to the variable PYTHON
354 echo import sys; sys.stdout.write(sys.executable) | (py -3 || py -2 || python3 || python2 || python) > %TEMP%\pythonlocation.txt 2> NUL
355 set /p PYTHON=<%TEMP%\pythonlocation.txt
357 if /i "%__BuildNative%"=="1" (
358 if NOT DEFINED PYTHON (
359 echo %__MsgPrefix%Error: Could not find a python installation
363 echo %__MsgPrefix%Laying out dynamically generated files consumed by the native build system
364 echo %__MsgPrefix%Laying out dynamically generated Event test files and etmdummy stub functions
365 "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEventing.py --inc %__IntermediatesIncDir% --dummy %__IntermediatesIncDir%\etmdummy.h --man %__SourceDir%\vm\ClrEtwAll.man --nonextern --noxplatheader|| exit /b 1
367 echo %__MsgPrefix%Laying out dynamically generated EventPipe Implementation
368 "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEventPipe.py --man %__SourceDir%\vm\ClrEtwAll.man --intermediate %__IntermediatesEventingDir%\eventpipe --nonextern || exit /b 1
370 echo %__MsgPrefix%Laying out ETW event logging interface
371 "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEtwProvider.py --man %__SourceDir%\vm\ClrEtwAll.man --intermediate %__IntermediatesIncDir% --exc %__SourceDir%\vm\ClrEtwAllMeta.lst || exit /b 1
374 if /i "%__DoCrossArchBuild%"=="1" (
375 if NOT DEFINED PYTHON (
376 echo %__MsgPrefix%Error: Could not find a python installation
380 set __CrossCompIntermediatesIncDir=%__CrossCompIntermediatesDir%\src\inc
381 set __CrossCompIntermediatesEventingDir=%__CrossCompIntermediatesDir%\eventing
383 echo %__MsgPrefix%Laying out dynamically generated files consumed by the crossarch build system
384 echo %__MsgPrefix%Laying out dynamically generated Event test files and etmdummy stub functions
385 "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEventing.py --inc !__CrossCompIntermediatesIncDir! --dummy !__CrossCompIntermediatesIncDir!\etmdummy.h --man %__SourceDir%\vm\ClrEtwAll.man --nonextern || exit /b 1
387 echo %__MsgPrefix%Laying out dynamically generated EventPipe Implementation
388 "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEventPipe.py --man %__SourceDir%\vm\ClrEtwAll.man --intermediate !__CrossCompIntermediatesEventingDir!\eventpipe --nonextern || exit /b 1
390 echo %__MsgPrefix%Laying out ETW event logging interface
391 "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEtwProvider.py --man %__SourceDir%\vm\ClrEtwAll.man --intermediate !__CrossCompIntermediatesIncDir! --exc %__SourceDir%\vm\ClrEtwAllMeta.lst || exit /b 1
394 REM =========================================================================================
396 REM === Build the CLR VM
398 REM =========================================================================================
400 if %__BuildNative% EQU 1 (
401 REM Scope environment changes start {
404 echo %__MsgPrefix%Commencing build of native components for %__BuildOS%.%__BuildArch%.%__BuildType%
406 set __NativePlatformArgs=-platform=%__BuildArch%
407 if not "%__ToolsetDir%" == "" ( set __NativePlatformArgs=-useEnv )
409 if not "%__ToolsetDir%" == "" (
410 rem arm64 builds currently use private toolset which has not been released yet
411 REM TODO, remove once the toolset is open.
416 :: Set the environment for the native build
417 set __VCBuildArch=x86_amd64
418 if /i "%__BuildArch%" == "x86" ( set __VCBuildArch=x86 )
419 if /i "%__BuildArch%" == "arm" (
420 set __VCBuildArch=x86_arm
422 REM Make CMake pick the highest installed version in the 10.0.* range
423 set ___SDKVersion="-DCMAKE_SYSTEM_VERSION=10.0"
425 if /i "%__BuildArch%" == "arm64" (
426 set __VCBuildArch=x86_arm64
428 REM Make CMake pick the highest installed version in the 10.0.* range
429 set ___SDKVersion="-DCMAKE_SYSTEM_VERSION=10.0"
432 echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch!
433 call "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch!
434 @if defined _echo @echo on
436 if not defined VSINSTALLDIR (
437 echo %__MsgPrefix%Error: VSINSTALLDIR variable not defined.
440 if not exist "!VSINSTALLDIR!DIA SDK" goto NoDIA
443 if defined __SkipConfigure goto SkipConfigure
445 echo %__MsgPrefix%Regenerating the Visual Studio solution
447 pushd "%__IntermediatesDir%"
448 set __ExtraCmakeArgs=!___SDKVersion! "-DCLR_CMAKE_TARGET_OS=%__BuildOs%" "-DCLR_CMAKE_PACKAGES_DIR=%__PackagesDir%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_VERSION=%__PgoOptDataVersion%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%"
449 call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__BuildArch% !__ExtraCmakeArgs!
450 @if defined _echo @echo on
454 if defined __ConfigureOnly goto SkipNativeBuild
456 if not exist "%__IntermediatesDir%\install.vcxproj" (
457 echo %__MsgPrefix%Error: failed to generate native component build project!
461 set __BuildLogRootName=CoreCLR
462 set __BuildLog="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
463 set __BuildWrn="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn"
464 set __BuildErr="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.err"
465 set __MsbuildLog=/flp:Verbosity=normal;LogFile=!__BuildLog!
466 set __MsbuildWrn=/flp1:WarningsOnly;LogFile=!__BuildWrn!
467 set __MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!
469 @call %__ProjectDir%\run.cmd build -Project=%__IntermediatesDir%\install.vcxproj -MsBuildLog=!__MsbuildLog! -MsBuildWrn=!__MsbuildWrn! -MsBuildErr=!__MsbuildErr! -configuration=%__BuildType% %__NativePlatformArgs% %__RunArgs% -MSBuildNodeCount="/m:2" %__UnprocessedBuildArgs%
471 if not !errorlevel! == 0 (
472 echo %__MsgPrefix%Error: native component build failed. Refer to the build log files for details:
480 REM } Scope environment changes end
484 REM =========================================================================================
486 REM === Build Cross-Architecture Native Components (if applicable)
488 REM =========================================================================================
490 if /i "%__DoCrossArchBuild%"=="1" (
491 REM Scope environment changes start {
494 echo %__MsgPrefix%Commencing build of cross architecture native components for %__BuildOS%.%__BuildArch%.%__BuildType%
496 :: Set the environment for the native build
497 set __VCBuildArch=x86_amd64
498 if /i "%__CrossArch%" == "x86" ( set __VCBuildArch=x86 )
500 echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch!
501 call "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch!
502 @if defined _echo @echo on
504 if not exist "%__CrossCompIntermediatesDir%" md "%__CrossCompIntermediatesDir%"
505 if defined __SkipConfigure goto SkipConfigureCrossBuild
507 pushd "%__CrossCompIntermediatesDir%"
508 set __CMakeBinDir=%__CrossComponentBinDir%
509 set "__CMakeBinDir=!__CMakeBinDir:\=/!"
510 set __ExtraCmakeArgs="-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCLR_CMAKE_TARGET_OS=%__BuildOs%" "-DCLR_CMAKE_PACKAGES_DIR=%__PackagesDir%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_VERSION=%__PgoOptDataVersion%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" "-DCMAKE_SYSTEM_VERSION=10.0"
511 call "%__SourceDir%\pal\tools\gen-buildsys-win.bat" "%__ProjectDir%" %__VSVersion% %__CrossArch% !__ExtraCmakeArgs!
512 @if defined _echo @echo on
515 :SkipConfigureCrossBuild
516 if not exist "%__CrossCompIntermediatesDir%\install.vcxproj" (
517 echo %__MsgPrefix%Error: failed to generate cross-arch components build project!
521 if defined __ConfigureOnly goto SkipCrossCompBuild
523 set __BuildLogRootName=Cross
524 set __BuildLog="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
525 set __BuildWrn="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn"
526 set __BuildErr="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.err"
527 set __MsbuildLog=/flp:Verbosity=normal;LogFile=!__BuildLog!
528 set __MsbuildWrn=/flp1:WarningsOnly;LogFile=!__BuildWrn!
529 set __MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!
531 @call %__ProjectDir%\run.cmd build -Project=%__CrossCompIntermediatesDir%\install.vcxproj -configuration=%__BuildType% -platform=%__CrossArch% -MsBuildLog=!__MsbuildLog! -MsBuildWrn=!__MsbuildWrn! -MsBuildErr=!__MsbuildErr! %__RunArgs% -MSBuildNodeCount="/m:2" %__UnprocessedBuildArgs%
533 if not !errorlevel! == 0 (
534 echo %__MsgPrefix%Error: cross-arch components build failed. Refer to the build log files for details:
542 REM } Scope environment changes end
546 REM =========================================================================================
548 REM === CoreLib and NuGet package build section.
550 REM =========================================================================================
552 if %__BuildCoreLib% EQU 1 (
553 REM Scope environment changes start {
556 echo %__MsgPrefix%Commencing build of System.Private.CoreLib for %__BuildOS%.%__BuildArch%.%__BuildType%
557 rem Explicitly set Platform causes conflicts in CoreLib project files. Clear it to allow building from VS x64 Native Tools Command Prompt
560 set __ExtraBuildArgs=
561 if not defined __IbcTuning (
562 set __ExtraBuildArgs=!__ExtraBuildArgs! -OptimizationDataDir="%__PackagesDir%/optimization.%__BuildOS%-%__BuildArch%.IBC.CoreCLR/%__IbcOptDataVersion%/data/"
563 set __ExtraBuildArgs=!__ExtraBuildArgs! -EnableProfileGuidedOptimization=true
566 if "%__BuildSOS%" == "0" (
567 set __ExtraBuildArgs=!__ExtraBuildArgs! -SkipSOS=true
570 if /i "%__BuildArch%" == "arm64" (
571 set __nugetBuildArgs=-buildNugetPackage=false
572 ) else if "%__SkipNugetPackage%" == "1" (
573 set __nugetBuildArgs=-buildNugetPackage=false
575 set __nugetBuildArgs=-buildNugetPackage=true
578 set __BuildLogRootName=System.Private.CoreLib
579 set __BuildLog="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
580 set __BuildWrn="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn"
581 set __BuildErr="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.err"
582 set __MsbuildLog=/flp:Verbosity=normal;LogFile=!__BuildLog!
583 set __MsbuildWrn=/flp1:WarningsOnly;LogFile=!__BuildWrn!
584 set __MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!
586 @call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\build.proj -MsBuildLog=!__MsbuildLog! -MsBuildWrn=!__MsbuildWrn! -MsBuildErr=!__MsbuildErr! !__nugetBuildArgs! %__RunArgs% !__ExtraBuildArgs! %__UnprocessedBuildArgs%
588 if not !errorlevel! == 0 (
589 echo %__MsgPrefix%Error: System.Private.CoreLib build failed. Refer to the build log files for details:
596 REM } Scope environment changes end
600 REM Scope environment changes start {
603 REM Need diasymreader.dll on your path for /CreatePdb
604 set PATH=%PATH%;%WinDir%\Microsoft.Net\Framework64\V4.0.30319;%WinDir%\Microsoft.Net\Framework\V4.0.30319
606 if %__BuildNativeCoreLib% EQU 1 (
607 echo %__MsgPrefix%Generating native image of System.Private.CoreLib for %__BuildOS%.%__BuildArch%.%__BuildType%. Logging to "%__CrossGenCoreLibLog%".
608 if exist "%__CrossGenCoreLibLog%" del "%__CrossGenCoreLibLog%"
610 REM Need VS native tools environment for the **target** arch when running instrumented binaries
611 if %__PgoInstrument% EQU 1 (
612 set __VCExecArch=%__BuildArch%
613 if /i [%__BuildArch%] == [x64] set __VCExecArch=amd64
614 echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" !__VCExecArch!
615 call "%__VCToolsRoot%\vcvarsall.bat" !__VCExecArch!
616 @if defined _echo @echo on
617 if NOT !errorlevel! == 0 (
618 echo %__MsgPrefix%Error: Failed to load native tools environment for !__VCExecArch!
622 REM HACK: Workaround for [dotnet/coreclr#13970](https://github.com/dotnet/coreclr/issues/13970)
624 for /f "tokens=*" %%f in ('where pgort*.dll') do (
625 if not defined __PgoRtPath set "__PgoRtPath=%%~f"
627 echo %__MsgPrefix%Copying "!__PgoRtPath!" into "%__BinDir%"
628 copy /y "!__PgoRtPath!" "%__BinDir%" || (
629 echo %__MsgPrefix%Error: copy failed
635 if defined __CrossgenAltJit (
636 REM Set altjit flags for the crossgen run. Note that this entire crossgen section is within a setlocal/endlocal scope,
637 REM so we don't need to save or unset these afterwards.
638 echo %__MsgPrefix%Setting altjit environment variables for %__CrossgenAltJit%.
639 echo %__MsgPrefix%Setting altjit environment variables for %__CrossgenAltJit%. >> "%__CrossGenCoreLibLog%"
641 set COMPlus_AltJitNgen=*
642 set COMPlus_AltJitName=%__CrossgenAltJit%
643 set COMPlus_AltJitAssertOnNYI=1
644 set COMPlus_NoGuiOnAssert=1
645 set COMPlus_ContinueOnAssert=0
648 set NEXTCMD="%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%"\IL /out "%__BinDir%\System.Private.CoreLib.dll" "%__BinDir%\IL\System.Private.CoreLib.dll"
649 echo %__MsgPrefix%!NEXTCMD!
650 echo %__MsgPrefix%!NEXTCMD! >> "%__CrossGenCoreLibLog%"
651 !NEXTCMD! >> "%__CrossGenCoreLibLog%" 2>&1
652 if NOT !errorlevel! == 0 (
653 echo %__MsgPrefix%Error: CrossGen System.Private.CoreLib build failed. Refer to %__CrossGenCoreLibLog%
654 :: Put it in the same log, helpful for Jenkins
655 type %__CrossGenCoreLibLog%
659 set NEXTCMD="%__CrossgenExe%" /Platform_Assemblies_Paths "%__BinDir%" /CreatePdb "%__BinDir%\PDB" "%__BinDir%\System.Private.CoreLib.dll"
660 echo %__MsgPrefix%!NEXTCMD!
661 echo %__MsgPrefix%!NEXTCMD! >> "%__CrossGenCoreLibLog%"
662 !NEXTCMD! >> "%__CrossGenCoreLibLog%" 2>&1
663 if NOT !errorlevel! == 0 (
664 echo %__MsgPrefix%Error: CrossGen /CreatePdb System.Private.CoreLib build failed. Refer to %__CrossGenCoreLibLog%
665 :: Put it in the same log, helpful for Jenkins
666 type %__CrossGenCoreLibLog%
671 REM } Scope environment changes end
675 if %__BuildPackages% EQU 1 (
676 REM Scope environment changes start {
679 echo %__MsgPrefix%Building Packages for %__BuildOS%.%__BuildArch%.%__BuildType%
681 set __BuildLogRootName=Nuget
682 set __BuildLog="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
683 set __BuildWrn="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn"
684 set __BuildErr="%__LogsDir%\!__BuildLogRootName!_%__BuildOS%__%__BuildArch%__%__BuildType%.err"
685 set __MsbuildLog=/flp:Verbosity=normal;LogFile=!__BuildLog!
686 set __MsbuildWrn=/flp1:WarningsOnly;LogFile=!__BuildWrn!
687 set __MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!
689 REM The conditions as to what to build are captured in the builds file.
690 @call %__ProjectDir%\run.cmd build -Project=%__SourceDir%\.nuget\packages.builds -platform=%__BuildArch% -MsBuildLog=!__MsbuildLog! -MsBuildWrn=!__MsbuildWrn! -MsBuildErr=!__MsbuildErr! %__RunArgs% %__UnprocessedBuildArgs%
692 if not !errorlevel! == 0 (
693 echo %__MsgPrefix%Error: Nuget package generation failed build failed. Refer to the build log files for details:
700 REM } Scope environment changes end
704 REM =========================================================================================
706 REM === Test build section
708 REM =========================================================================================
710 if %__BuildTests% EQU 1 (
711 echo %__MsgPrefix%Commencing build of tests for %__BuildOS%.%__BuildArch%.%__BuildType%
713 REM Construct the arguments to pass to the test build script.
715 rem arm64 builds currently use private toolset which has not been released yet
716 REM TODO, remove once the toolset is open.
717 if not "%__ToolsetDir%" == "" call :PrivateToolSet
719 set NEXTCMD=call %__ProjectDir%\build-test.cmd %__BuildArch% %__BuildType% %__UnprocessedBuildArgs%
720 echo %__MsgPrefix%!NEXTCMD!
723 if not !errorlevel! == 0 (
724 REM buildtest.cmd has already emitted an error message and mentioned the build log file to examine.
727 ) else if %__GenerateLayout% EQU 1 (
728 echo %__MsgPrefix%Generating layout for %__BuildOS%.%__BuildArch%.%__BuildType%
730 REM Construct the arguments to pass to the runtest build script.
732 rem arm64 builds currently use private toolset which has not been released yet
733 REM TODO, remove once the toolset is open.
734 if not "%__ToolsetDir%" == "" call :PrivateToolSet
736 set NEXTCMD=call %__ProjectDir%\test\runtest.cmd %__BuildArch% %__BuildType% GenerateLayoutOnly %__UnprocessedBuildArgs%
737 echo %__MsgPrefix%!NEXTCMD!
740 if not !errorlevel! == 0 (
741 REM runtest.cmd has already emitted an error message and mentioned the build log file to examine.
746 REM =========================================================================================
748 REM === All builds complete!
750 REM =========================================================================================
752 echo %__MsgPrefix%Repo successfully built. Finished at %TIME%
753 echo %__MsgPrefix%Product binaries are available at !__BinDir!
754 if %__BuildTests% EQU 1 (
755 echo %__MsgPrefix%Test binaries are available at !__TestBinDir!
759 REM =========================================================================================
761 REM === Handle the "all" case.
763 REM =========================================================================================
769 set /A __TotalSpecifiedBuildArch=__BuildArchX64 + __BuildArchX86 + __BuildArchArm + __BuildArchArm64
770 if %__TotalSpecifiedBuildArch% EQU 0 (
771 REM Nothing specified means we want to build all architectures.
772 set __BuildArchList=x64 x86 arm arm64
775 REM Otherwise, add all the specified architectures to the list.
777 if %__BuildArchX64%==1 set __BuildArchList=%__BuildArchList% x64
778 if %__BuildArchX86%==1 set __BuildArchList=%__BuildArchList% x86
779 if %__BuildArchArm%==1 set __BuildArchList=%__BuildArchList% arm
780 if %__BuildArchArm64%==1 set __BuildArchList=%__BuildArchList% arm64
784 set /A __TotalSpecifiedBuildType=__BuildTypeDebug + __BuildTypeChecked + __BuildTypeRelease
785 if %__TotalSpecifiedBuildType% EQU 0 (
786 REM Nothing specified means we want to build all build types.
787 set __BuildTypeList=Debug Checked Release
790 if %__BuildTypeDebug%==1 set __BuildTypeList=%__BuildTypeList% Debug
791 if %__BuildTypeChecked%==1 set __BuildTypeList=%__BuildTypeList% Checked
792 if %__BuildTypeRelease%==1 set __BuildTypeList=%__BuildTypeList% Release
794 REM Create a temporary file to collect build results. We always build all flavors specified, and
795 REM report a summary of the results at the end.
797 set __AllBuildSuccess=true
798 set __BuildResultFile=%TEMP%\build-all-summary-%RANDOM%.txt
799 if exist %__BuildResultFile% del /f /q %__BuildResultFile%
801 for %%i in (%__BuildArchList%) do (
802 for %%j in (%__BuildTypeList%) do (
803 call :BuildOne %%i %%j
807 if %__AllBuildSuccess%==true (
808 echo %__MsgPrefix%All builds succeeded!
811 echo %__MsgPrefix%Builds failed:
812 type %__BuildResultFile%
813 del /f /q %__BuildResultFile%
817 REM This code is unreachable, but leaving it nonetheless, just in case things change.
823 set __NextCmd=call %__ThisScriptFull% %__BuildArch% %__BuildType% %__PassThroughArgs%
824 echo %__MsgPrefix%Invoking: %__NextCmd%
826 if not !errorlevel! == 0 (
827 echo %__MsgPrefix% %__BuildArch% %__BuildType% %__PassThroughArgs% >> %__BuildResultFile%
828 set __AllBuildSuccess=false
832 REM =========================================================================================
834 REM === Helper routines
836 REM =========================================================================================
843 echo Build the CoreCLR repo.
846 echo build.cmd [option1] [option2]
848 echo build.cmd all [option1] [option2] -- ...
850 echo All arguments are optional. The options are:
852 echo.-? -h -help --help: view this message.
853 echo -all: Builds all configurations and platforms.
854 echo Build architecture: one of -x64, -x86, -arm, -arm64 ^(default: -x64^).
855 echo Build type: one of -Debug, -Checked, -Release ^(default: -Debug^).
856 echo -- ... : all arguments following this tag will be passed directly to msbuild.
857 echo mscorlib version: one of -freebsdmscorlib, -linuxmscorlib, -netbsdmscorlib, -osxmscorlib,
858 echo or -windowsmscorlib. If one of these is passed, only System.Private.CoreLib is built,
859 echo for the specified platform ^(FreeBSD, Linux, NetBSD, OS X or Windows,
861 echo add nativemscorlib to go further and build the native image for designated mscorlib.
862 echo -toolset_dir ^<dir^> : set the toolset directory -- Arm64 use only. Required for Arm64 builds.
863 echo -nopgooptimize: do not use profile guided optimizations.
864 echo -enforcepgo: verify after the build that PGO was used for key DLLs, and fail the build if not
865 echo -pgoinstrument: generate instrumented code for profile guided optimization enabled binaries.
866 echo -ibcinstrument: generate IBC-tuning-enabled native images when invoking crossgen.
867 echo -configureonly: skip all builds; only run CMake ^(default: CMake and builds are run^)
868 echo -skipconfigure: skip CMake ^(default: CMake is run^)
869 echo -skipmscorlib: skip building System.Private.CoreLib ^(default: System.Private.CoreLib is built^).
870 echo -skipnative: skip building native components ^(default: native components are built^).
871 echo -skiptests: skip building tests ^(default: tests are built^).
872 echo -skipbuildpackages: skip building nuget packages ^(default: packages are built^).
873 echo -skiprestoreoptdata: skip restoring optimization data used by profile-based optimizations.
874 echo -skiprestore: skip restoring packages ^(default: packages are restored during build^).
875 echo -disableoss: Disable Open Source Signing for System.Private.CoreLib.
876 echo -priority=^<N^> : specify a set of test that will be built and run, with priority N.
877 echo -officialbuildid=^<ID^>: specify the official build ID to be used by this build.
878 echo -Rebuild: passes /t:rebuild to the build projects.
879 echo -crossgenaltjit ^<JIT dll^>: run crossgen using specified altjit ^(used for JIT testing^).
880 echo portable : build for portable RID.
882 echo If "all" is specified, then all build architectures and types are built. If, in addition,
883 echo one or more build architectures or types is specified, then only those build architectures
884 echo and types are built.
888 echo -- builds all architectures, and all build types per architecture
890 echo -- builds all build types for x86
891 echo build -all -x64 -x86 -Checked -Release
892 echo -- builds x64 and x86 architectures, Checked and Release build types for each
896 echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^
897 This is due to a bug in the Visual Studio installer. It does not install DIA SDK at "%VSINSTALLDIR%" but rather ^
898 at the install location of previous Visual Studio version. The workaround is to copy the DIA SDK folder from the Visual Studio install location ^
899 of the previous version to "%VSINSTALLDIR%" and then build.
900 :: DIA SDK not included in Express editions
901 echo Visual Studio Express does not include the DIA SDK. ^
902 You need Visual Studio 2015 or 2017 (Community is free).
903 echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites
908 echo %__MsgPrefix%Setting up the usage of __ToolsetDir:%__ToolsetDir%
910 if /i "%__ToolsetDir%" == "" (
911 echo %__MsgPrefix%Error: A toolset directory is required for the Arm64 Windows build. Use the toolset_dir argument.
915 if not exist "%__ToolsetDir%"\buildenv_arm64.cmd goto :Not_EWDK
916 call "%__ToolsetDir%"\buildenv_arm64.cmd
920 set PATH=%__ToolsetDir%\VC_sdk\bin;%PATH%
921 set LIB=%__ToolsetDir%\VC_sdk\lib\arm64;%__ToolsetDir%\sdpublic\sdk\lib\arm64
923 %__ToolsetDir%\VC_sdk\inc;^
924 %__ToolsetDir%\sdpublic\sdk\inc;^
925 %__ToolsetDir%\sdpublic\shared\inc;^
926 %__ToolsetDir%\sdpublic\shared\inc\minwin;^
927 %__ToolsetDir%\sdpublic\sdk\inc\ucrt;^
928 %__ToolsetDir%\sdpublic\sdk\inc\minwin;^
929 %__ToolsetDir%\sdpublic\sdk\inc\mincore;^
930 %__ToolsetDir%\sdpublic\sdk\inc\abi;^
931 %__ToolsetDir%\sdpublic\sdk\inc\clientcore;^
932 %__ToolsetDir%\diasdk\include