Skip to content

Commit 18329a7

Browse files
committed
utils: add the rules to build swift-build
Add a smoke test build of swift-build. While this is not integrated into SPM, it allows us to ensure that swift-build is able to be built with the just built compiler on Windows.
1 parent 725bd91 commit 18329a7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

utils/build.ps1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ enum HostComponent {
469469
ASN1
470470
Certificates
471471
System
472+
Build
472473
PackageManager
473474
Markdown
474475
Format
@@ -2499,6 +2500,28 @@ function Build-System($Arch) {
24992500
}
25002501
}
25012502

2503+
function Build-Build($Arch) {
2504+
Build-CMakeProject `
2505+
-Src $SourceCache\swift-build `
2506+
-Bin (Get-HostProjectBinaryCache Build) `
2507+
-InstallTo "$($Arch.ToolchainInstallRoot)\usr" `
2508+
-Arch $Arch `
2509+
-Platform Windows `
2510+
-UseBuiltCompilers C,CXX,Swift `
2511+
-SwiftSDK (Get-HostSwiftSDK) `
2512+
-Defines @{
2513+
BUILD_SHARED_LIBS = "YES";
2514+
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
2515+
ArgumentParser_DIR = (Get-HostProjectCMakeModules ArgumentParser);
2516+
LLBuild_DIR = (Get-HostProjectCMakeModules LLBuild);
2517+
SwiftDriver_DIR = (Get-HostProjectCMakeModules Driver);
2518+
SwiftSystem_DIR = (Get-HostProjectCMakeModules System);
2519+
TSC_DIR = (Get-HostProjectCMakeModules ToolsSupportCore);
2520+
SQLite3_INCLUDE_DIR = "$LibraryRoot\sqlite-3.46.0\usr\include";
2521+
SQLite3_LIBRARY = "$LibraryRoot\sqlite-3.46.0\usr\lib\SQLite3.lib";
2522+
}
2523+
}
2524+
25022525
function Build-ToolsSupportCore($Arch) {
25032526
Build-CMakeProject `
25042527
-Src $SourceCache\swift-tools-support-core `
@@ -3217,6 +3240,7 @@ if (-not $SkipBuild) {
32173240
Invoke-BuildStep Build-ASN1 $HostArch
32183241
Invoke-BuildStep Build-Certificates $HostArch
32193242
Invoke-BuildStep Build-System $HostArch
3243+
Invoke-BuildStep Build-Build $HostArch
32203244
Invoke-BuildStep Build-PackageManager $HostArch
32213245
Invoke-BuildStep Build-Markdown $HostArch
32223246
Invoke-BuildStep Build-Format $HostArch

0 commit comments

Comments
 (0)