Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit eac7ef0

Browse files
authored
Add copy_gen_snapshots.py tool (#10430)
Copies and renames the architecture-dependent iOS variants of gen_snapshot to a destination directory. Now that the armv7-emitting variant of gen_snapshot is 64-bit we can no longer bundle up gen_snapshot as a fat binary with the x86 armv7 variant merged with the x86_64 arm64 variant.
1 parent c3cc104 commit eac7ef0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env python
2+
# Copyright 2013 The Flutter Authors. All rights reserved.
3+
# Use of this source code is governed by a BSD-style license that can be
4+
# found in the LICENSE file.
5+
6+
import argparse
7+
import shutil
8+
import sys
9+
import os
10+
11+
12+
def main():
13+
parser = argparse.ArgumentParser(description='Copies architecture-dependent gen_snapshot binaries to output dir')
14+
15+
parser.add_argument('--dst', type=str, required=True)
16+
parser.add_argument('--arm64-out-dir', type=str, required=True)
17+
parser.add_argument('--armv7-out-dir', type=str, required=True)
18+
19+
args = parser.parse_args()
20+
21+
arm64_gen_snapshot = os.path.join(args.arm64_out_dir, 'clang_x64', 'gen_snapshot')
22+
armv7_gen_snapshot = os.path.join(args.armv7_out_dir, 'clang_x64', 'gen_snapshot')
23+
24+
if not os.path.isfile(arm64_gen_snapshot):
25+
print 'Cannot find x86_64 (arm64) gen_snapshot at', arm64_gen_snapshot
26+
return 1
27+
28+
if not os.path.isfile(armv7_gen_snapshot):
29+
print 'Cannot find i386 (armv7) gen_snapshot at', armv7_gen_snapshot
30+
return 1
31+
32+
shutil.copy(armv7_gen_snapshot, os.path.join(args.dst, 'gen_snapshot_armv7'))
33+
shutil.copy(arm64_gen_snapshot, os.path.join(args.dst, 'gen_snapshot_arm64'))
34+
35+
36+
if __name__ == '__main__':
37+
sys.exit(main())
38+

0 commit comments

Comments
 (0)