Skip to content
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

Add tool to create multi-arch iOS gen_snapshot #4948

Merged
merged 1 commit into from
Apr 7, 2018
Merged
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
45 changes: 45 additions & 0 deletions sky/tools/create_macos_gen_snapshot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env python
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import argparse
import subprocess
import sys
import os


def main():
parser = argparse.ArgumentParser(description='Creates multi-arch gen_snapshot')

parser.add_argument('--dst', type=str, required=True)
parser.add_argument('--arm64-out-dir', type=str, required=True)
parser.add_argument('--armv7-out-dir', type=str, required=True)

args = parser.parse_args()

fat_gen_snapshot = os.path.join(args.dst, 'gen_snapshot')
arm64_gen_snapshot = os.path.join(args.arm64_out_dir, 'clang_x64', 'gen_snapshot')
armv7_gen_snapshot = os.path.join(args.armv7_out_dir, 'clang_x86', 'gen_snapshot')

if not os.path.isfile(arm64_gen_snapshot):
print 'Cannot find x86_64 (arm64) gen_snapshot at', arm64_gen_snapshot
return 1

if not os.path.isfile(armv7_gen_snapshot):
print 'Cannot find i386 (armv7) gen_snapshot at', armv7_gen_snapshot
return 1

subprocess.call([
'lipo',
arm64_gen_snapshot,
armv7_gen_snapshot,
'-create',
'-output',
fat_gen_snapshot,
])


if __name__ == '__main__':
sys.exit(main())