@@ -696,6 +696,7 @@ enum Project {
696
696
BuildTools
697
697
RegsGen2
698
698
699
+ CDispatch
699
700
Compilers
700
701
FoundationMacros
701
702
TestingMacros
@@ -1940,6 +1941,20 @@ function Load-LitTestOverrides($Filename) {
1940
1941
}
1941
1942
}
1942
1943
1944
+ function Build-CDispatch ([Hashtable ] $Platform , [switch ] $Static = $false ) {
1945
+ Build-CMakeProject `
1946
+ - Src $SourceCache \swift- corelibs- libdispatch `
1947
+ - Bin (Get-ProjectBinaryCache $Platform CDispatch) `
1948
+ - BuildTargets default `
1949
+ - Platform $Platform `
1950
+ - UsePinnedCompilers C, CXX `
1951
+ - Defines @ {
1952
+ BUILD_SHARED_LIBS = " YES" ;
1953
+ BUILD_TESTING = " NO" ;
1954
+ ENABLE_SWIFT = " NO" ;
1955
+ }
1956
+ }
1957
+
1943
1958
function Get-CompilersDefines ([Hashtable ] $Platform , [string ] $Variant , [switch ] $Test ) {
1944
1959
$BuildTools = [IO.Path ]::Combine((Get-ProjectBinaryCache $BuildPlatform BuildTools), " bin" )
1945
1960
$PythonRoot = [IO.Path ]::Combine((Get-PythonPath $Platform ), " tools" )
@@ -2550,17 +2565,11 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
2550
2565
- UseGNUDriver `
2551
2566
- Defines @ {
2552
2567
BUILD_SHARED_LIBS = if ($Static ) { " NO" } else { " YES" };
2553
- # TODO(compnerd) enforce dynamic linking of BlocksRuntime and dispatch.
2554
- CMAKE_CXX_FLAGS = $ (if ($Static ) { @ (" -Ddispatch_STATIC" ) } else { @ () });
2555
- CMAKE_Swift_FLAGS = $ (if ($Static ) { @ (" -Xcc" , " -static-libclosure" ) } else { @ () });
2556
2568
CMAKE_STATIC_LIBRARY_PREFIX_Swift = " lib" ;
2557
2569
2558
- # NOTE(compnerd) we can get away with this currently because we only
2559
- # use the C portion of the dispatch build, which is supposed to always
2560
- # be built dynamically. Currently, we do not do this due to limitations
2561
- # of the build system, but because we are building statically, we do
2562
- # not link against the runtime and can get away with it.
2563
- dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
2570
+ dispatch_DIR = (Get-ProjectCMakeModules $Platform CDispatch);
2571
+
2572
+ # FIXME(compnerd) remove this once the default option is flipped to `ON`.
2564
2573
SwiftCore_ENABLE_CONCURRENCY = " YES" ;
2565
2574
}
2566
2575
@@ -3005,6 +3014,8 @@ function Build-SDK([Hashtable] $Platform, [switch] $IncludeMacros = $false) {
3005
3014
}
3006
3015
3007
3016
function Build-ExperimentalSDK ([Hashtable ] $Platform ) {
3017
+ Invoke-BuildStep Build-CDispatch $Platform
3018
+
3008
3019
# TODO(compnerd) we currently build the experimental SDK with just the static
3009
3020
# variant. We should aim to build both dynamic and static variants.
3010
3021
Invoke-BuildStep Build-ExperimentalRuntime $Platform - Static
@@ -3712,6 +3723,7 @@ if (-not $SkipBuild) {
3712
3723
3713
3724
Invoke-BuildStep Build-CMark $HostPlatform
3714
3725
Invoke-BuildStep Build-XML2 $HostPlatform
3726
+ Invoke-BuildStep Build-CDispatch $HostPlatform
3715
3727
Invoke-BuildStep Build-Compilers $HostPlatform - Variant " Asserts"
3716
3728
3717
3729
Invoke-BuildStep Build-SDK $BuildPlatform - IncludeMacros
0 commit comments