if defined VisualStudioVersion (
if not defined __VSVersion echo %__MsgPrefix%Detected Visual Studio %VisualStudioVersion% developer command ^prompt environment
goto :Run
-)
+)
echo %__MsgPrefix%Searching ^for Visual Studio 2017 or 2015 installation
set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
set __BuildPackages=1
set __BuildNativeCoreLib=1
set __RestoreOptData=1
-set __AltJitCrossgen=0
+set __CrossgenAltJit=
@REM CMD has a nasty habit of eating "=" on the argument list, so passing:
@REM -priority=1
if /i "%1" == "-nopgooptimize" (set __PgoOptimize=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-ibcinstrument" (set __IbcTuning=/Tuning&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "-toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
-if /i "%1" == "-altjitcrossgen" (set __AltJitCrossgen=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
+if /i "%1" == "-crossgenaltjit" (set __CrossgenAltJit=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
REM TODO these are deprecated remove them eventually
REM don't add more, use the - syntax instead
)
)
+REM Determine if this is a cross-arch build
+
+if /i "%__BuildArch%"=="arm64" (
+ set __DoCrossArchBuild=1
+ )
+
+if /i "%__BuildArch%"=="arm" (
+ set __DoCrossArchBuild=1
+ )
+
:: Set the remaining variables based upon the determined build configuration
set "__BinDir=%__RootBinDir%\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__IntermediatesDir=%__RootBinDir%\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
REM =========================================================================================
REM ===
+REM === Generate source files for eventing
+REM ===
+REM =========================================================================================
+
+set __IntermediatesIncDir=%__IntermediatesDir%\src\inc
+set __IntermediatesEventingDir=%__IntermediatesDir%\eventing
+
+REM Find python and set it to the variable PYTHON
+echo import sys; sys.stdout.write(sys.executable) | (py -3 || py -2 || python3 || python2 || python) > %TEMP%\pythonlocation.txt 2> NUL
+set /p PYTHON=<%TEMP%\pythonlocation.txt
+
+if /i "%__BuildNative%"=="1" (
+ if NOT DEFINED PYTHON (
+ echo %__MsgPrefix%Error: Could not find a python installation
+ exit /b 1
+ )
+
+ echo %__MsgPrefix%Laying out dynamically generated files consumed by the native build system
+ echo %__MsgPrefix%Laying out dynamically generated Event test files and etmdummy stub functions
+ "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEventing.py --inc %__IntermediatesIncDir% --dummy %__IntermediatesIncDir%\etmdummy.h --man %__SourceDir%\vm\ClrEtwAll.man --nonextern --noxplatheader|| exit /b 1
+
+ echo %__MsgPrefix%Laying out dynamically generated EventPipe Implementation
+ "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEventPipe.py --man %__SourceDir%\vm\ClrEtwAll.man --intermediate %__IntermediatesEventingDir%\eventpipe --nonextern || exit /b 1
+
+ echo %__MsgPrefix%Laying out ETW event logging interface
+ "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEtwProvider.py --man %__SourceDir%\vm\ClrEtwAll.man --intermediate %__IntermediatesIncDir% --exc %__SourceDir%\vm\ClrEtwAllMeta.lst || exit /b 1
+)
+
+if /i "%__DoCrossArchBuild%"=="1" (
+ if NOT DEFINED PYTHON (
+ echo %__MsgPrefix%Error: Could not find a python installation
+ exit /b 1
+ )
+
+ set __CrossCompIntermediatesIncDir=%__CrossCompIntermediatesDir%\src\inc
+ set __CrossCompIntermediatesEventingDir=%__CrossCompIntermediatesDir%\eventing
+
+ echo %__MsgPrefix%Laying out dynamically generated files consumed by the crossarch build system
+ echo %__MsgPrefix%Laying out dynamically generated Event test files and etmdummy stub functions
+ "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEventing.py --inc !__CrossCompIntermediatesIncDir! --dummy !__CrossCompIntermediatesIncDir!\etmdummy.h --man %__SourceDir%\vm\ClrEtwAll.man --nonextern || exit /b 1
+
+ echo %__MsgPrefix%Laying out dynamically generated EventPipe Implementation
+ "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEventPipe.py --man %__SourceDir%\vm\ClrEtwAll.man --intermediate !__CrossCompIntermediatesEventingDir!\eventpipe --nonextern || exit /b 1
+
+ echo %__MsgPrefix%Laying out ETW event logging interface
+ "!PYTHON!" -B -Wall %__SourceDir%\scripts\genEtwProvider.py --man %__SourceDir%\vm\ClrEtwAll.man --intermediate !__CrossCompIntermediatesIncDir! --exc %__SourceDir%\vm\ClrEtwAllMeta.lst || exit /b 1
+)
+
+REM =========================================================================================
+REM ===
REM === Build the CLR VM
REM ===
REM =========================================================================================
REM ===
REM =========================================================================================
-if /i "%__BuildArch%"=="arm64" (
- set __DoCrossArchBuild=1
- )
-
-if /i "%__BuildArch%"=="arm" (
- set __DoCrossArchBuild=1
- )
-
if /i "%__DoCrossArchBuild%"=="1" (
REM Scope environment changes start {
setlocal
REM End HACK
)
- if %__AltJitCrossgen% EQU 1 (
+ if defined __CrossgenAltJit (
REM Set altjit flags for the crossgen run. Note that this entire crossgen section is within a setlocal/endlocal scope,
REM so we don't need to save or unset these afterwards.
- echo %__MsgPrefix%Setting altjit environment variables.
- echo %__MsgPrefix%Setting altjit environment variables. >> "%__CrossGenCoreLibLog%"
+ echo %__MsgPrefix%Setting altjit environment variables for %__CrossgenAltJit%.
+ echo %__MsgPrefix%Setting altjit environment variables for %__CrossgenAltJit%. >> "%__CrossGenCoreLibLog%"
set COMPlus_AltJit=*
set COMPlus_AltJitNgen=*
- set COMPlus_AltJitName=protojit.dll
+ set COMPlus_AltJitName=%__CrossgenAltJit%
set COMPlus_AltJitAssertOnNYI=1
set COMPlus_NoGuiOnAssert=1
set COMPlus_ContinueOnAssert=0
echo -priority=^<N^> : specify a set of test that will be built and run, with priority N.
echo -officialbuildid=^<ID^>: specify the official build ID to be used by this build.
echo -Rebuild: passes /t:rebuild to the build projects.
-echo -altjitcrossgen: run crossgen using altjit ^(used for JIT testing^).
+echo -crossgenaltjit ^<JIT dll^>: run crossgen using specified altjit ^(used for JIT testing^).
echo portable : build for portable RID.
echo.
echo If "all" is specified, then all build architectures and types are built. If, in addition,