From 548758857f1b89521407c0b486b5e300cfd5478f Mon Sep 17 00:00:00 2001 From: Conrad Kramer Date: Wed, 6 Oct 2021 14:38:06 -0700 Subject: [PATCH] Fix Xcode support in xenia-build --- xenia-build | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/xenia-build b/xenia-build index 7586582ab..ebcba477e 100755 --- a/xenia-build +++ b/xenia-build @@ -822,9 +822,16 @@ class BaseBuildCommand(Command): ] + ([targets] if targets is not None else []) + pass_args, shell=False) elif sys.platform == 'darwin': - # TODO(benvanik): other platforms. - print('ERROR: don\'t know how to build on this platform.') - result = 1 + schemes = args['target'] if len(args['target']) else ['xenia-app'] + nested_args = [['-scheme', scheme] for scheme in schemes] + scheme_args = [arg for pair in nested_args for arg in pair] + result = subprocess.call([ + 'xcodebuild', + '-workspace', + 'build/xenia.xcworkspace', + '-configuration', + args['config'] + ] + scheme_args + pass_args, shell=False, env=dict(os.environ)) else: result = subprocess.call([ 'make', @@ -1690,6 +1697,9 @@ class DevenvCommand(Command): print('ERROR: Visual Studio is not installed.'); return 1 print('Launching Visual Studio...') + elif sys.platform == 'darwin': + print('Launching Xcode...') + devenv = 'xcode4' elif has_bin('clion') or has_bin('clion.sh'): print('Launching CLion...') show_reload_prompt = create_clion_workspace() @@ -1711,6 +1721,11 @@ class DevenvCommand(Command): 'devenv', 'build\\xenia.sln', ]) + elif sys.platform == 'darwin': + shell_call([ + 'xed', + 'build/xenia.xcworkspace', + ]) elif has_bin('clion'): shell_call([ 'clion',