Skip to content

Commit 3a70b9a

Browse files
authored
Merge pull request swiftlang#235 from rudkx/add-distcc
Refactor common leading arguments out and add --distcc.
2 parents b001e29 + b3f0f6b commit 3a70b9a

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

run

+22-17
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# This source file is part of the Swift.org open source project
55
#
6-
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6+
# Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
77
# Licensed under Apache License v2.0 with Runtime Library Exception
88
#
99
# See https://swift.org/LICENSE.txt for license information
@@ -91,6 +91,9 @@ def parse_args():
9191
'names from projects.json enclosed in {} will be '
9292
'replaced with their value)',
9393
default='')
94+
parser.add_argument("--distcc",
95+
help='Pass --distcc to the build script',
96+
action='store_true')
9497
return parser.parse_args()
9598

9699

@@ -192,18 +195,25 @@ def execute_build_incremental(workspace, args):
192195

193196

194197
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+
195210
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 += [
203214
'--ios',
204215
'--tvos',
205216
'--watchos',
206-
'--skip-build-benchmarks',
207217
'--build-subdir=compat_macos',
208218
'--compiler-vendor=apple',
209219
'--',
@@ -228,17 +238,12 @@ def build_swift_toolchain(workspace, args):
228238
'--reconfigure',
229239
]
230240
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 += [
238244
'--foundation',
239245
'--libdispatch',
240246
'--xctest',
241-
'--skip-build-benchmarks',
242247
'--build-subdir=compat_linux',
243248
'--',
244249
'--install-foundation',

0 commit comments

Comments
 (0)