mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Move build_script_helper from ./benchmarks/utils => ./benchmarks/scripts.
This commit is contained in:
44
benchmark/scripts/build_script_helper.py
Executable file
44
benchmark/scripts/build_script_helper.py
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--verbose', '-v', action='store_true')
|
||||
parser.add_argument('--package-path', type=str, required=True)
|
||||
parser.add_argument('--build-path', type=str, required=True)
|
||||
parser.add_argument('--toolchain', type=str, required=True)
|
||||
|
||||
# Build the debug/release versions.
|
||||
args = parser.parse_args()
|
||||
swiftbuild_path = os.path.join(args.toolchain, 'usr', 'bin', 'swift-build')
|
||||
swiftbuild_args = [
|
||||
swiftbuild_path,
|
||||
'--package-path', args.package_path,
|
||||
'--build-path', args.build_path,
|
||||
'--configuration', 'debug',
|
||||
]
|
||||
if args.verbose:
|
||||
swiftbuild_args.append('--verbose')
|
||||
subprocess.call(swiftbuild_args)
|
||||
|
||||
swiftbuild_args = [
|
||||
swiftbuild_path,
|
||||
'--package-path', args.package_path,
|
||||
'--build-path', args.build_path,
|
||||
'--configuration', 'release',
|
||||
'-Xswiftc', '-Xllvm',
|
||||
'-Xswiftc', '-align-module-to-page-size',
|
||||
]
|
||||
if args.verbose:
|
||||
swiftbuild_args.append('--verbose')
|
||||
subprocess.call(swiftbuild_args)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user