@@ -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,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 ,
176
177
"-DCMAKE_C_FLAGS=" + llvm_c_flags ,
177
178
"-DCMAKE_CXX_FLAGS=" + llvm_c_flags ,
178
179
]
@@ -499,6 +500,16 @@ Example invocations:
499
500
default = default_ninja ,
500
501
help = "the path to ninja (default = %s)" % default_ninja ,
501
502
)
503
+ option (
504
+ "--swiftc" ,
505
+ store_path ,
506
+ default = None ,
507
+ help = """
508
+ Override the swiftc compiler used to build SwiftCompilerSources.
509
+ This is needed to build the most recent state of main if it uses C++ interop
510
+ features that aren't in the host's toolchain yet.
511
+ """
512
+ )
502
513
503
514
parser = optbuilder .build ()
504
515
args = parser .parse_args ()
0 commit comments