Skip to content

Commit

Permalink
Merge pull request apple#235 from rudkx/add-distcc
Browse files Browse the repository at this point in the history
Refactor common leading arguments out and add --distcc.
  • Loading branch information
rudkx committed Aug 16, 2018
2 parents b001e29 + b3f0f6b commit 3a70b9a
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions run
Expand Up @@ -3,7 +3,7 @@
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -91,6 +91,9 @@ def parse_args():
'names from projects.json enclosed in {} will be '
'replaced with their value)',
default='')
parser.add_argument("--distcc",
help='Pass --distcc to the build script',
action='store_true')
return parser.parse_args()


Expand Down Expand Up @@ -192,18 +195,25 @@ def execute_build_incremental(workspace, args):


def build_swift_toolchain(workspace, args):
build_script_args_common = [
'--debug' if args.debug else '--release',
'--assertions' if args.assertions else '--no-assertions',
'--build-ninja',
'--llbuild',
'--swiftpm',
'--skip-build-benchmarks',
]

if args.distcc:
build_script_args_common += ['--distcc']

if platform.system() == 'Darwin':
build_command = [
os.path.join(workspace, 'swift/utils/build-script'),
'--debug' if args.debug else '--release',
'--assertions' if args.assertions else '--no-assertions',
'--build-ninja',
'--llbuild',
'--swiftpm',
build_command = [os.path.join(workspace, 'swift/utils/build-script')]
build_command += build_script_args_common
build_command += [
'--ios',
'--tvos',
'--watchos',
'--skip-build-benchmarks',
'--build-subdir=compat_macos',
'--compiler-vendor=apple',
'--',
Expand All @@ -228,17 +238,12 @@ def build_swift_toolchain(workspace, args):
'--reconfigure',
]
elif platform.system() == 'Linux':
build_command = [
os.path.join(workspace, 'swift/utils/build-script'),
'--debug' if args.debug else '--release',
'--assertions' if args.assertions else '--no-assertions',
'--build-ninja',
'--llbuild',
'--swiftpm',
build_command = [os.path.join(workspace, 'swift/utils/build-script')]
build_command += build_script_args_common
build_command += [
'--foundation',
'--libdispatch',
'--xctest',
'--skip-build-benchmarks',
'--build-subdir=compat_linux',
'--',
'--install-foundation',
Expand Down

0 comments on commit 3a70b9a

Please sign in to comment.