Skip to content

Commit 38f1c0a

Browse files
committed
[build-tooling-libs] Add option to specify the swiftc compiler to build compiler sources
This is needed to build the most recent state of main if it uses C++ interop features that aren't in the host's toolchain yet.
1 parent 57807fb commit 38f1c0a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

utils/build-tooling-libs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class Builder(object):
6767
self.host = host
6868
self.arch = arch
6969
self.native_build_dir = native_build_dir
70+
self.swiftc = args.swiftc or self.toolchain.swiftc
7071

7172
def call(self, command, env=None, without_sleeping=False):
7273
if without_sleeping:
@@ -172,7 +173,7 @@ class Builder(object):
172173
"-DSWIFT_HOST_VARIANT_SDK=" + host_sdk,
173174
"-DSWIFT_HOST_VARIANT_ARCH=" + self.arch,
174175
"-DCMAKE_Swift_COMPILER_TARGET=" + host_triple,
175-
"-DCMAKE_Swift_COMPILER=" + self.toolchain.swiftc,
176+
"-DCMAKE_Swift_COMPILER=" + self.swiftc,
176177
"-DCMAKE_C_FLAGS=" + llvm_c_flags,
177178
"-DCMAKE_CXX_FLAGS=" + llvm_c_flags,
178179
]
@@ -499,6 +500,16 @@ Example invocations:
499500
default=default_ninja,
500501
help="the path to ninja (default = %s)" % default_ninja,
501502
)
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+
)
502513

503514
parser = optbuilder.build()
504515
args = parser.parse_args()

0 commit comments

Comments
 (0)