Skip to content

Commit a781ef9

Browse files
krypton36isiu-apple
authored andcommitted
Resolve comilation issue for darwin-framework-tool on M1 (project-chip#21761)
1 parent 36937e4 commit a781ef9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

scripts/build/build_darwin_framework.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import argparse
1616
import os
1717
from subprocess import PIPE, Popen
18+
import platform
1819

1920

2021
def run_command(command):
@@ -41,7 +42,18 @@ def build_darwin_framework(args):
4142
if not os.path.exists(abs_path):
4243
os.mkdir(abs_path)
4344

44-
command = ['xcodebuild', '-scheme', args.target, '-sdk', 'macosx', '-project', args.project_path, '-derivedDataPath', abs_path]
45+
command = [
46+
'xcodebuild',
47+
'-scheme',
48+
args.target,
49+
'-sdk',
50+
'macosx',
51+
'-project',
52+
args.project_path,
53+
'-derivedDataPath',
54+
abs_path,
55+
"PLATFORM_PREFERRED_ARCH={}".format(platform.machine())
56+
]
4557
command_result = run_command(command)
4658

4759
print("Build Framework Result: {}".format(command_result))

0 commit comments

Comments
 (0)