@@ -52,6 +52,8 @@ set __BuildTypeChecked=0
52
52
set __BuildTypeRelease = 0
53
53
set __BuildJit32 = " -DBUILD_JIT32=0"
54
54
55
+ set __PgoInstrument = 0
56
+
55
57
REM __PassThroughArgs is a set of things that will be passed through to nested calls to build.cmd
56
58
REM when using "all".
57
59
set __PassThroughArgs =
@@ -103,6 +105,7 @@ if /i "%1" == "skiptests" (set __BuildTests=0&set processedArgs=!proce
103
105
if /i " %1 " == " skipbuildpackages" (set __BuildPackages=0& set processedArgs=!processedArgs! %1 & shift& goto Arg_Loop)
104
106
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)
105
107
if /i " %1 " == " buildjit32" (set __BuildJit32=" -DBUILD_JIT32=1" & set processedArgs=!processedArgs! %1 & shift& goto Arg_Loop)
108
+ if /i " %1 " == " pgoinstrument" (set __PgoInstrument=1& set processedArgs=!processedArgs! %1 & shift& goto Arg_Loop)
106
109
if /i " %1 " == " toolset_dir" (set __ToolsetDir=%2 & set __PassThroughArgs=%__PassThroughArgs% %2 & set processedArgs=!processedArgs! %1 %2 & shift& shift& goto Arg_Loop)
107
110
108
111
if [!processedArgs! ]== [] (
@@ -186,6 +189,15 @@ call "%__VSToolsRoot%\VsDevCmd.bat"
186
189
187
190
@ call %__ProjectDir% \run.cmd build -Project=%__ProjectDir% \build.proj -generateHeaderWindows -NativeVersionHeaderFile=" %__RootBinDir% \obj\_version.h" %__RunArgs% %__UnprocessedBuildArgs%
188
191
192
+ REM =========================================================================================
193
+ REM ===
194
+ REM === Restore optimization profile data
195
+ REM ===
196
+ REM =========================================================================================
197
+
198
+ echo %__MsgPrefix% Restoring the OptimizationData Package
199
+ @ call %__ProjectDir% \run.cmd sync -optdata
200
+
189
201
REM =========================================================================================
190
202
REM ===
191
203
REM === Build the CLR VM
@@ -228,7 +240,8 @@ if %__BuildNative% EQU 1 (
228
240
echo %__MsgPrefix% Regenerating the Visual Studio solution
229
241
230
242
pushd " %__IntermediatesDir% "
231
- call " %__SourceDir% \pal\tools\gen-buildsys-win.bat" " %__ProjectDir% " %__VSVersion% %__BuildArch% %__BuildJit32%
243
+ set __ExtraCmakeArgs = " -DCLR_CMAKE_TARGET_OS=%__BuildOs% " " -DCLR_CMAKE_PACKAGES_DIR=%__PackagesDir% " " -DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument% "
244
+ call " %__SourceDir% \pal\tools\gen-buildsys-win.bat" " %__ProjectDir% " %__VSVersion% %__BuildArch% %__BuildJit32% !__ExtraCmakeArgs!
232
245
@ if defined __echo @ echo on
233
246
popd
234
247
:SkipConfigure
@@ -281,7 +294,7 @@ if /i "%__DoCrossArchBuild%"=="1" (
281
294
pushd " %__CrossCompIntermediatesDir% "
282
295
set __CMakeBinDir = %__CrossComponentBinDir%
283
296
set " __CMakeBinDir = !__CMakeBinDir:\ =/ ! "
284
- set __ExtraCmakeArgs = " -DCLR_CROSS_COMPONENTS_BUILD=1" " -DCLR_CMAKE_TARGET_ARCH=%__BuildArch% "
297
+ 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% "
285
298
call " %__SourceDir% \pal\tools\gen-buildsys-win.bat" " %__ProjectDir% " %__VSVersion% %__CrossArch% !__ExtraCmakeArgs!
286
299
@ if defined __echo @ echo on
287
300
popd
@@ -522,6 +535,7 @@ echo for the specified platform ^(FreeBSD, Linux, NetBSD, OS X or Windows,
522
535
echo respectively^ ).
523
536
echo add nativemscorlib to go further and build the native image for designated mscorlib.
524
537
echo toolset_dir ^ < dir^ > : set the toolset directory -- Arm64 use only. Required for Arm64 builds.
538
+ echo pgoinstrument: generate instrumented code for profile guided optimization enabled binaries.
525
539
echo configureonly: skip all builds; only run CMake ^ (default: CMake and builds are run^ )
526
540
echo skipconfigure: skip CMake ^ (default: CMake is run^ )
527
541
echo skipmscorlib: skip building System.Private.CoreLib ^ (default: System.Private.CoreLib is built^ ).
0 commit comments