@@ -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,16 @@ function Get-AndroidNDKPath {
335
340
return $androidNDKPath
336
341
}
337
342
343
+ function Get-FlexExecutable {
344
+ $flexExecutable = Join-Path - Path $BinaryCache - ChildPath " win_flex_bison\win_flex.exe"
345
+ return $flexExecutable
346
+ }
347
+
348
+ function Get-BisonExecutable {
349
+ $bisonExecutable = Join-Path - Path $BinaryCache - ChildPath " win_flex_bison\win_bison.exe"
350
+ return $bisonExecutable
351
+ }
352
+
338
353
function Get-InstallDir ($Arch ) {
339
354
if ($Arch -eq $HostArch ) {
340
355
$ProgramFilesName = " Program Files"
@@ -431,6 +446,7 @@ enum HostComponent {
431
446
LMDB
432
447
SymbolKit
433
448
DocC
449
+ RegsGen2
434
450
}
435
451
436
452
function Get-HostProjectBinaryCache ([HostComponent ]$Project ) {
@@ -739,6 +755,15 @@ function Fetch-Dependencies {
739
755
Extract- ZipFile - ZipFileName " android-ndk-$AndroidNDKVersion -windows.zip" - BinaryCache $BinaryCache - ExtractPath " android-ndk-$AndroidNDKVersion " - CreateExtractPath $false
740
756
}
741
757
758
+ if ($IncludeDS2 ) {
759
+ $WinFlexBisonVersion = " 2.5.25"
760
+ $WinFlexBisonURL = " https://github.com/lexxmark/winflexbison/releases/download/v$WinFlexBisonVersion /win_flex_bison-$WinFlexBisonVersion .zip"
761
+ $WinFlexBisonHash = " 8D324B62BE33604B2C45AD1DD34AB93D722534448F55A16CA7292DE32B6AC135"
762
+ DownloadAndVerify $WinFlexBisonURL " $BinaryCache \win_flex_bison-$WinFlexBisonVersion .zip" $WinFlexBisonHash
763
+
764
+ Extract- ZipFile - ZipFileName " win_flex_bison-$WinFlexBisonVersion .zip" - BinaryCache $BinaryCache - ExtractPath " win_flex_bison"
765
+ }
766
+
742
767
if ($WinSDKVersion ) {
743
768
try {
744
769
# Check whether VsDevShell can already resolve the requested Windows SDK Version
@@ -1490,6 +1515,39 @@ function Build-XML2([Platform]$Platform, $Arch) {
1490
1515
}
1491
1516
}
1492
1517
1518
+ function Build-RegsGen2 ($Arch ) {
1519
+ $ArchName = $Arch.LLVMName
1520
+
1521
+ Build-CMakeProject `
1522
+ - Src $SourceCache \ds2\Tools\RegsGen2 `
1523
+ - Bin " $ ( Get-HostProjectBinaryCache RegsGen2) " `
1524
+ - Arch $Arch `
1525
+ - BuildTargets default `
1526
+ - UseMSVCCompilers C, CXX `
1527
+ - Defines @ {
1528
+ BISON_EXECUTABLE = " $ ( Get-BisonExecutable ) " ;
1529
+ FLEX_EXECUTABLE = " $ ( Get-FlexExecutable ) " ;
1530
+ }
1531
+ }
1532
+
1533
+ function Build-DS2 ([Platform ]$Platform , $Arch ) {
1534
+ $ArchName = $Arch.LLVMTarget.Replace (" $AndroidAPILevel " , " " )
1535
+
1536
+ Build-CMakeProject `
1537
+ - Src " $SourceCache \ds2" `
1538
+ - Bin " $ ( $Arch.BinaryCache ) \$Platform \ds2" `
1539
+ - InstallTo " $ ( $Arch.PlatformInstallRoot ) \Developer\Library\$ArchName " `
1540
+ - Arch $Arch `
1541
+ - Platform $Platform `
1542
+ - BuildTargets default `
1543
+ - Defines @ {
1544
+ CMAKE_SYSTEM_NAME = $Platform.ToString ();
1545
+ DS2_REGSGEN2 = " $ ( Get-HostProjectBinaryCache RegsGen2) /regsgen2.exe"
1546
+ BISON_EXECUTABLE = " $ ( Get-BisonExecutable ) " ;
1547
+ FLEX_EXECUTABLE = " $ ( Get-FlexExecutable ) " ;
1548
+ }
1549
+ }
1550
+
1493
1551
function Build-CURL ([Platform ]$Platform , $Arch ) {
1494
1552
$ArchName = $Arch.LLVMName
1495
1553
@@ -2471,6 +2529,10 @@ if ($Clean) {
2471
2529
}
2472
2530
}
2473
2531
2532
+ if (-not $SkipBuild -and $IncludeDS2 ) {
2533
+ Invoke-BuildStep Build-RegsGen2 $HostArch
2534
+ }
2535
+
2474
2536
if (-not $SkipBuild ) {
2475
2537
foreach ($Arch in $WindowsSDKArchs ) {
2476
2538
Invoke-BuildStep Build-ZLib Windows $Arch
@@ -2491,6 +2553,9 @@ if (-not $SkipBuild) {
2491
2553
}
2492
2554
2493
2555
foreach ($Arch in $AndroidSDKArchs ) {
2556
+ if ($IncludeDS2 ) {
2557
+ Invoke-BuildStep Build-DS2 Android $Arch
2558
+ }
2494
2559
Invoke-BuildStep Build-ZLib Android $Arch
2495
2560
Invoke-BuildStep Build-XML2 Android $Arch
2496
2561
Invoke-BuildStep Build-CURL Android $Arch
0 commit comments