[benchmarks] Add support to the build-script swiftpm benchmarks for building the benchmarks in -Osize.

This commit is contained in:
Michael Gottesman
2019-04-10 22:07:41 -07:00
parent 6ea773e136
commit c86c1763c6
2 changed files with 8 additions and 2 deletions

View File

@@ -10,8 +10,9 @@ import subprocess
def perform_build(args, swiftbuild_path, config, binary_name, opt_flag):
assert(config in ['debug', 'release'])
assert(binary_name in ['Benchmark_O', 'Benchmark_Onone'])
assert(opt_flag in ['-O', '-Onone'])
assert(binary_name in ['Benchmark_O', 'Benchmark_Osize',
'Benchmark_Onone'])
assert(opt_flag in ['-O', '-Osize', '-Onone'])
inner_build_dir = os.path.join(args.build_path, binary_name)
swiftbuild_args = [
@@ -49,6 +50,8 @@ def main():
swiftbuild_path = os.path.join(args.toolchain, 'usr', 'bin', 'swift-build')
perform_build(args, swiftbuild_path, 'debug', 'Benchmark_Onone', '-Onone')
perform_build(args, swiftbuild_path, 'release', 'Benchmark_Osize',
'-Osize')
perform_build(args, swiftbuild_path, 'release', 'Benchmark_O', '-O')