@@ -62,6 +62,10 @@ The version number of the Windows SDK to be used.
62
62
Overrides the value resolved by the Visual Studio command prompt.
63
63
If no such Windows SDK is installed, it will be downloaded from nuget.
64
64
65
+ . PARAMETER IncludeDS2
66
+ Include the ds2 remote debug server in the SDK.
67
+ This component is currently only supported in Android builds.
68
+
65
69
. PARAMETER SkipBuild
66
70
If set, does not run the build phase.
67
71
@@ -125,6 +129,7 @@ param(
125
129
[switch ] $SkipBuild = $false ,
126
130
[switch ] $SkipRedistInstall = $false ,
127
131
[switch ] $SkipPackaging = $false ,
132
+ [switch ] $IncludeDS2 = $false ,
128
133
[string []] $Test = @ (),
129
134
[string ] $Stage = " " ,
130
135
[string ] $BuildTo = " " ,
@@ -335,6 +340,14 @@ function Get-AndroidNDKPath {
335
340
return $androidNDKPath
336
341
}
337
342
343
+ function Get-FlexExecutable {
344
+ return Join-Path - Path $BinaryCache - ChildPath " win_flex_bison\win_flex.exe"
345
+ }
346
+
347
+ function Get-BisonExecutable {
348
+ return Join-Path - Path $BinaryCache - ChildPath " win_flex_bison\win_bison.exe"
349
+ }
350
+
338
351
function Get-InstallDir ($Arch ) {
339
352
if ($Arch -eq $HostArch ) {
340
353
$ProgramFilesName = " Program Files"
@@ -446,6 +459,7 @@ enum BuildComponent {
446
459
Compilers
447
460
FoundationMacros
448
461
TestingMacros
462
+ RegsGen2
449
463
}
450
464
451
465
function Get-BuildProjectBinaryCache ([BuildComponent ]$Project ) {
@@ -739,6 +753,15 @@ function Fetch-Dependencies {
739
753
Extract- ZipFile - ZipFileName " android-ndk-$AndroidNDKVersion -windows.zip" - BinaryCache $BinaryCache - ExtractPath " android-ndk-$AndroidNDKVersion " - CreateExtractPath $false
740
754
}
741
755
756
+ if ($IncludeDS2 ) {
757
+ $WinFlexBisonVersion = " 2.5.25"
758
+ $WinFlexBisonURL = " https://github.com/lexxmark/winflexbison/releases/download/v$WinFlexBisonVersion /win_flex_bison-$WinFlexBisonVersion .zip"
759
+ $WinFlexBisonHash = " 8D324B62BE33604B2C45AD1DD34AB93D722534448F55A16CA7292DE32B6AC135"
760
+ DownloadAndVerify $WinFlexBisonURL " $BinaryCache \win_flex_bison-$WinFlexBisonVersion .zip" $WinFlexBisonHash
761
+
762
+ Extract- ZipFile - ZipFileName " win_flex_bison-$WinFlexBisonVersion .zip" - BinaryCache $BinaryCache - ExtractPath " win_flex_bison"
763
+ }
764
+
742
765
if ($WinSDKVersion ) {
743
766
try {
744
767
# Check whether VsDevShell can already resolve the requested Windows SDK Version
@@ -1490,6 +1513,39 @@ function Build-XML2([Platform]$Platform, $Arch) {
1490
1513
}
1491
1514
}
1492
1515
1516
+ function Build-RegsGen2 ($Arch ) {
1517
+ $ArchName = $Arch.LLVMName
1518
+
1519
+ Build-CMakeProject `
1520
+ - Src $SourceCache \ds2\Tools\RegsGen2 `
1521
+ - Bin " $ ( Get-BuildProjectBinaryCache RegsGen2) " `
1522
+ - Arch $Arch `
1523
+ - BuildTargets default `
1524
+ - UseMSVCCompilers C, CXX `
1525
+ - Defines @ {
1526
+ BISON_EXECUTABLE = " $ ( Get-BisonExecutable ) " ;
1527
+ FLEX_EXECUTABLE = " $ ( Get-FlexExecutable ) " ;
1528
+ }
1529
+ }
1530
+
1531
+ function Build-DS2 ([Platform ]$Platform , $Arch ) {
1532
+ $ArchName = $Arch.LLVMTarget.Replace (" $AndroidAPILevel " , " " )
1533
+
1534
+ Build-CMakeProject `
1535
+ - Src " $SourceCache \ds2" `
1536
+ - Bin " $ ( $Arch.BinaryCache ) \$Platform \ds2" `
1537
+ - InstallTo " $ ( $Arch.PlatformInstallRoot ) \Developer\Library\$ArchName " `
1538
+ - Arch $Arch `
1539
+ - Platform $Platform `
1540
+ - BuildTargets default `
1541
+ - Defines @ {
1542
+ CMAKE_SYSTEM_NAME = $Platform.ToString ();
1543
+ DS2_REGSGEN2 = " $ ( Get-BuildProjectBinaryCache RegsGen2) /regsgen2.exe" ;
1544
+ BISON_EXECUTABLE = " $ ( Get-BisonExecutable ) " ;
1545
+ FLEX_EXECUTABLE = " $ ( Get-FlexExecutable ) " ;
1546
+ }
1547
+ }
1548
+
1493
1549
function Build-CURL ([Platform ]$Platform , $Arch ) {
1494
1550
$ArchName = $Arch.LLVMName
1495
1551
@@ -2459,6 +2515,9 @@ if (-not $SkipBuild) {
2459
2515
if ($IsCrossCompiling ) {
2460
2516
Invoke-BuildStep Build-Compilers - Build $BuildArch
2461
2517
}
2518
+ if ($IncludeDS2 ) {
2519
+ Invoke-BuildStep Build-RegsGen2 $BuildArch
2520
+ }
2462
2521
2463
2522
Invoke-BuildStep Build-CMark $HostArch
2464
2523
Invoke-BuildStep Build-Compilers $HostArch
@@ -2491,6 +2550,9 @@ if (-not $SkipBuild) {
2491
2550
}
2492
2551
2493
2552
foreach ($Arch in $AndroidSDKArchs ) {
2553
+ if ($IncludeDS2 ) {
2554
+ Invoke-BuildStep Build-DS2 Android $Arch
2555
+ }
2494
2556
Invoke-BuildStep Build-ZLib Android $Arch
2495
2557
Invoke-BuildStep Build-XML2 Android $Arch
2496
2558
Invoke-BuildStep Build-CURL Android $Arch
0 commit comments