mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
The dynamic services SDK produces a fat Mach binary of x64 and arm64 variants.
This commit is contained in:
parent
6b1dfda1ee
commit
3cf712d230
52
engine/src/flutter/sky/tools/lipo.py
Executable file
52
engine/src/flutter/sky/tools/lipo.py
Executable file
@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2015 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 MakeStamp(stamp_path):
|
||||
dir_name = os.path.dirname(stamp_path)
|
||||
|
||||
if not os.path.isdir(dir_name):
|
||||
os.makedirs()
|
||||
|
||||
with open(stamp_path, 'a'):
|
||||
os.utime(stamp_path, None)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Creates a FAT Mach binary')
|
||||
|
||||
parser.add_argument('--path', action='append', dest='paths',
|
||||
default=[], help='The path to a Mach binary')
|
||||
parser.add_argument('--output', type=str)
|
||||
parser.add_argument('--stamp', type=str)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
cmd = [
|
||||
'/usr/bin/env',
|
||||
'xcrun',
|
||||
'lipo',
|
||||
]
|
||||
|
||||
cmd.extend(args.paths)
|
||||
|
||||
cmd.extend([
|
||||
'-create',
|
||||
'-output',
|
||||
args.output,
|
||||
])
|
||||
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
MakeStamp(args.stamp)
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
Loading…
x
Reference in New Issue
Block a user