Skip to content

Add cmake-c-launcher and cmake-cxx-launcher flag for build-script #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ def parse_args():
dest='build_config',
help='specify "debug" or "release" to override '
'the build configuration in the projects.json file')
parser.add_argument('--cmake-c-launcher',
metavar="PATH",
help='the absolute path to set CMAKE_C_COMPILER_LAUNCHER for build script')
parser.add_argument('--cmake-cxx-launcher',
metavar='PATH',
help='the absolute path to set CMAKE_CXX_COMPILER_LAUNCHER for build script')
return parser.parse_args()


Expand Down Expand Up @@ -216,6 +222,11 @@ def build_swift_toolchain(workspace, args):
if args.distcc:
build_script_args_common += ['--distcc']

if args.cmake_c_launcher:
build_script_args_common += ['--cmake-c-launcher={}'.format(args.cmake_c_launcher)]
if args.cmake_cxx_launcher:
build_script_args_common += ['--cmake-cxx-launcher={}'.format(args.cmake_cxx_launcher)]

if platform.system() == 'Darwin':
build_command = [os.path.join(workspace, 'swift/utils/build-script')]
build_command += build_script_args_common
Expand Down
40 changes: 24 additions & 16 deletions run_cperf
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,25 @@ def get_swiftc_path(instance, workspace, args):


def build_swift_toolchain(workspace, args):
build_script_args_common = [
'--release',
'--no-assertions',
'--build-ninja',
'--llbuild',
'--swiftpm',
'--skip-build-benchmarks',
]
if args.cmake_c_launcher:
build_script_args_common += ['--cmake-c-launcher={}'.format(args.cmake_c_launcher)]
if args.cmake_cxx_launcher:
build_script_args_common += ['--cmake-cxx-launcher={}'.format(args.cmake_cxx_launcher)]
if platform.system() == 'Darwin':
build_command = [
os.path.join(workspace, 'swift/utils/build-script'),
'--release',
'--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 @@ -218,17 +225,12 @@ def build_swift_toolchain(workspace, args):
'--reconfigure',
]
elif platform.system() == 'Linux':
build_command = [
os.path.join(workspace, 'swift/utils/build-script'),
'--release',
'--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 Expand Up @@ -623,6 +625,12 @@ def parse_args():
type=bool, default=False)
parser.add_argument('--self-test',
action='store_true')
parser.add_argument('--cmake-c-launcher',
metavar="PATH",
help='the absolute path to set CMAKE_C_COMPILER_LAUNCHER for build script')
parser.add_argument('--cmake-cxx-launcher',
metavar='PATH',
help='the absolute path to set CMAKE_CXX_COMPILER_LAUNCHER for build script')
return parser.parse_args()


Expand Down