3
3
#
4
4
# This source file is part of the Swift.org open source project
5
5
#
6
- # Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6
+ # Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
7
7
# Licensed under Apache License v2.0 with Runtime Library Exception
8
8
#
9
9
# See https://swift.org/LICENSE.txt for license information
@@ -91,6 +91,9 @@ def parse_args():
91
91
'names from projects.json enclosed in {} will be '
92
92
'replaced with their value)' ,
93
93
default = '' )
94
+ parser .add_argument ("--distcc" ,
95
+ help = 'Pass --distcc to the build script' ,
96
+ action = 'store_true' )
94
97
return parser .parse_args ()
95
98
96
99
@@ -192,18 +195,25 @@ def execute_build_incremental(workspace, args):
192
195
193
196
194
197
def build_swift_toolchain (workspace , args ):
198
+ build_script_args_common = [
199
+ '--debug' if args .debug else '--release' ,
200
+ '--assertions' if args .assertions else '--no-assertions' ,
201
+ '--build-ninja' ,
202
+ '--llbuild' ,
203
+ '--swiftpm' ,
204
+ '--skip-build-benchmarks' ,
205
+ ]
206
+
207
+ if args .distcc :
208
+ build_script_args_common += ['--distcc' ]
209
+
195
210
if platform .system () == 'Darwin' :
196
- build_command = [
197
- os .path .join (workspace , 'swift/utils/build-script' ),
198
- '--debug' if args .debug else '--release' ,
199
- '--assertions' if args .assertions else '--no-assertions' ,
200
- '--build-ninja' ,
201
- '--llbuild' ,
202
- '--swiftpm' ,
211
+ build_command = [os .path .join (workspace , 'swift/utils/build-script' )]
212
+ build_command += build_script_args_common
213
+ build_command += [
203
214
'--ios' ,
204
215
'--tvos' ,
205
216
'--watchos' ,
206
- '--skip-build-benchmarks' ,
207
217
'--build-subdir=compat_macos' ,
208
218
'--compiler-vendor=apple' ,
209
219
'--' ,
@@ -228,17 +238,12 @@ def build_swift_toolchain(workspace, args):
228
238
'--reconfigure' ,
229
239
]
230
240
elif platform .system () == 'Linux' :
231
- build_command = [
232
- os .path .join (workspace , 'swift/utils/build-script' ),
233
- '--debug' if args .debug else '--release' ,
234
- '--assertions' if args .assertions else '--no-assertions' ,
235
- '--build-ninja' ,
236
- '--llbuild' ,
237
- '--swiftpm' ,
241
+ build_command = [os .path .join (workspace , 'swift/utils/build-script' )]
242
+ build_command += build_script_args_common
243
+ build_command += [
238
244
'--foundation' ,
239
245
'--libdispatch' ,
240
246
'--xctest' ,
241
- '--skip-build-benchmarks' ,
242
247
'--build-subdir=compat_linux' ,
243
248
'--' ,
244
249
'--install-foundation' ,
0 commit comments