Skip to content

Commit 9f62de9

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 2b3e53a commit 9f62de9

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
@@ -452,6 +452,7 @@ enum HostComponent {
452452
ASN1
453453
Certificates
454454
System
455+
Build
455456
PackageManager
456457
Markdown
457458
Format
@@ -2485,6 +2486,28 @@ function Build-System($Arch) {
24852486
}
24862487
}
24872488

2489+
function Build-Build($Arch) {
2490+
Build-CMakeProject `
2491+
-Src $SourceCache\swift-build `
2492+
-Bin (Get-HostProjectBinaryCache Build) `
2493+
-InstallTo "$($Arch.ToolchainInstallRoot)\usr" `
2494+
-Arch $Arch `
2495+
-Platform Windows `
2496+
-UseBuiltCompilers C,CXX,Swift `
2497+
-SwiftSDK (Get-SwiftSDK Windows) `
2498+
-Defines @{
2499+
BUILD_SHARED_LIBS = "YES";
2500+
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
2501+
ArgumentParser_DIR = (Get-HostProjectCMakeModules ArgumentParser);
2502+
LLBuild_DIR = (Get-HostProjectCMakeModules LLBuild);
2503+
SwiftDriver_DIR = (Get-HostProjectCMakeModules Driver);
2504+
SwiftSystem_DIR = (Get-HostProjectCMakeModules System);
2505+
TSC_DIR = (Get-HostProjectCMakeModules ToolsSupportCore);
2506+
SQLite3_INCLUDE_DIR = "$LibraryRoot\sqlite-3.46.0\usr\include";
2507+
SQLite3_LIBRARY = "$LibraryRoot\sqlite-3.46.0\usr\lib\SQLite3.lib";
2508+
}
2509+
}
2510+
24882511
function Build-ToolsSupportCore($Arch) {
24892512
Build-CMakeProject `
24902513
-Src $SourceCache\swift-tools-support-core `
@@ -3202,6 +3225,7 @@ if (-not $SkipBuild) {
32023225
Invoke-BuildStep Build-ASN1 $HostArch
32033226
Invoke-BuildStep Build-Certificates $HostArch
32043227
Invoke-BuildStep Build-System $HostArch
3228+
Invoke-BuildStep Build-Build $HostArch
32053229
Invoke-BuildStep Build-PackageManager $HostArch
32063230
Invoke-BuildStep Build-Markdown $HostArch
32073231
Invoke-BuildStep Build-Format $HostArch

0 commit comments

Comments
 (0)