@@ -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_path = args .swiftc_path
70
71
71
72
def call (self , command , env = None , without_sleeping = False ):
72
73
if without_sleeping :
@@ -172,7 +173,7 @@ 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_path ,
176
177
"-DCMAKE_C_FLAGS=" + llvm_c_flags ,
177
178
"-DCMAKE_CXX_FLAGS=" + llvm_c_flags ,
178
179
]
@@ -400,6 +401,7 @@ Example invocations:
400
401
defaults .DARWIN_INSTALL_PREFIX if isDarwin else defaults .UNIX_INSTALL_PREFIX
401
402
)
402
403
default_ninja = toolchain .ninja
404
+ default_swiftc = toolchain .swiftc
403
405
404
406
option ("--release" , store_true , help = "build in release mode" )
405
407
option (
@@ -499,6 +501,16 @@ Example invocations:
499
501
default = default_ninja ,
500
502
help = "the path to ninja (default = %s)" % default_ninja ,
501
503
)
504
+ option (
505
+ "--swiftc-path" ,
506
+ store_path ,
507
+ default = default_swiftc ,
508
+ help = """
509
+ Override the swiftc compiler used to build SwiftCompilerSources.
510
+ This is needed to build the most recent state of main if it uses C++ interop
511
+ features that aren't in the host's toolchain yet. (default = %s)
512
+ """ % default_swiftc
513
+ )
502
514
503
515
parser = optbuilder .build ()
504
516
args = parser .parse_args ()
0 commit comments