@@ -67,6 +67,7 @@ class Builder(object):
67
67
self .host = host
68
68
self .arch = arch
69
69
self .native_build_dir = native_build_dir
70
+ self .swiftc = args .swiftc or self .toolchain .swiftc
70
71
71
72
def call (self , command , env = None , without_sleeping = False ):
72
73
if without_sleeping :
@@ -172,10 +173,14 @@ class Builder(object):
172
173
"-DSWIFT_HOST_VARIANT_SDK=" + host_sdk ,
173
174
"-DSWIFT_HOST_VARIANT_ARCH=" + self .arch ,
174
175
"-DCMAKE_Swift_COMPILER_TARGET=" + host_triple ,
175
- "-DCMAKE_Swift_COMPILER=" + self .toolchain . swiftc ,
176
+ "-DCMAKE_Swift_COMPILER=" + self .swiftc ,
176
177
"-DCMAKE_C_FLAGS=" + llvm_c_flags ,
177
178
"-DCMAKE_CXX_FLAGS=" + llvm_c_flags ,
178
179
]
180
+ if self .swiftc :
181
+ cmake_args += [
182
+ f"-DCMAKE_Swift_COMPILER={ self .swiftc } "
183
+ ]
179
184
if isEmbeddedHost :
180
185
cmake_args += [
181
186
"-DCMAKE_OSX_SYSROOT:PATH=" + xcrun .sdk_path (self .host ),
@@ -499,6 +504,16 @@ Example invocations:
499
504
default = default_ninja ,
500
505
help = "the path to ninja (default = %s)" % default_ninja ,
501
506
)
507
+ option (
508
+ "--swiftc" ,
509
+ store_path ,
510
+ default = None ,
511
+ help = """
512
+ Override the swiftc compiler used to build SwiftCompilerSources.
513
+ This is needed to build the most recent state of main if it uses C++ interop
514
+ features that aren't in the host's toolchain yet.
515
+ """
516
+ )
502
517
503
518
parser = optbuilder .build ()
504
519
args = parser .parse_args ()
0 commit comments