diff --git a/run b/run index ba1f01f6..d3e3c4d7 100755 --- a/run +++ b/run @@ -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() @@ -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 diff --git a/run_cperf b/run_cperf index 18a46a09..0dab8a56 100755 --- a/run_cperf +++ b/run_cperf @@ -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', '--', @@ -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', @@ -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()