From 0d52056fdb102f40887abd47c9bc2af5f3cca94e Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Sat, 9 Mar 2024 01:05:22 -0300 Subject: [PATCH] fix: Xcode 15.3+ not setting TARGET_OS_IPHONE correctly (#242) --- metadata-generator/build-step-metadata-generator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/metadata-generator/build-step-metadata-generator.py b/metadata-generator/build-step-metadata-generator.py index ef80977e..ede0531f 100755 --- a/metadata-generator/build-step-metadata-generator.py +++ b/metadata-generator/build-step-metadata-generator.py @@ -144,6 +144,10 @@ def generate_metadata(arch): deployment_target_flag_name + "=" + deployment_target]) else: generator_call.extend(["-target", "{}-{}-{}{}".format(arch, llvm_target_triple_vendor, llvm_target_triple_os_version, llvm_target_triple_suffix)]) + # since iPhoneOS 17.4 sdk TARGET_OS_IPHONE is not defined for non-simulator builds + # this seems to be a bug on Apple's side + if effective_platform_name == "-iphoneos" and not llvm_target_triple_suffix: + generator_call.extend(["-DTARGET_OS_IPHONE=1"]) generator_call.extend(header_search_paths_parsed) # HEADER_SEARCH_PATHS generator_call.extend(framework_search_paths_parsed) # FRAMEWORK_SEARCH_PATHS