From 10687945bbf3cc065db7b3eaea4b4cdf8957354f Mon Sep 17 00:00:00 2001 From: Joshua Villasenor Date: Tue, 9 Aug 2022 13:32:41 -0700 Subject: [PATCH] Resolve comilation issue for darwin-framework-tool on M1 (#21761) --- scripts/build/build_darwin_framework.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/build/build_darwin_framework.py b/scripts/build/build_darwin_framework.py index bfc7e33bafe057..7f7f8f25be0de8 100644 --- a/scripts/build/build_darwin_framework.py +++ b/scripts/build/build_darwin_framework.py @@ -15,6 +15,7 @@ import argparse import os from subprocess import PIPE, Popen +import platform def run_command(command): @@ -41,7 +42,18 @@ def build_darwin_framework(args): if not os.path.exists(abs_path): os.mkdir(abs_path) - command = ['xcodebuild', '-scheme', args.target, '-sdk', 'macosx', '-project', args.project_path, '-derivedDataPath', abs_path] + command = [ + 'xcodebuild', + '-scheme', + args.target, + '-sdk', + 'macosx', + '-project', + args.project_path, + '-derivedDataPath', + abs_path, + "PLATFORM_PREFERRED_ARCH={}".format(platform.machine()) + ] command_result = run_command(command) print("Build Framework Result: {}".format(command_result))