Repository: godotengine/godot (language: cpp)

Issue:
Unable to export iOS builds
### Tested versions

Reproducible in: 4.4.beta1 [4ce466d7fa79e351d4295d5bb47e3266089c3a59]

### System information

Godot v4.4.beta1 - macOS Sequoia (15.2.0) - Multi-window, 1 monitor - Metal (Forward+) - integrated Apple M2 Pro (Apple8) - Apple M2 Pro (10 threads)

### Issue description

When trying to export any project to iOS, you are currently met with the following errors when it tries to build the Xcode project:

```
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_MTLFXSpatialScalerDescriptor", referenced from:
       in libgodot.a[1031](metal_device_properties.ios.template_debug.arm64.o)
  "_OBJC_CLASS_$_MTLFXTemporalScalerDescriptor", referenced from:
       in libgodot.a[1031](metal_device_properties.ios.template_debug.arm64.o)
ld: symbol(s) not found for architecture arm64
```

Given the symbols it's complaining about, I would imagine it's at least related to (if not caused by) #99603.

It's possible to work around this by manually adding `MetalFX.framework` as a linked library in Xcode, but I'm not sure what the implications of that are on the minimum required iOS version, given that MetalFX seems to be iOS 16 or later.

I imagine it's possible to add this library with something like `add_ios_framework("MetalFX.framework")` from within an `EditorExportPlugin` as well.

### Steps to reproduce

1. Create a new project
2. Export to iOS
3. Note the error

### Minimal reproduction project (MRP)

N/A


Discussion / hints:
> given that MetalFX seems to be iOS 16 or later

That's not good, we probably need to load `MetalFX.framework` dynamically, instead of adding it to the project since it should support iOS 12.
As we haven't published the beta 1 blog post yet, we should probably redo the builds with this fixed, and release it tomorrow instead. Releasing a highly anticipated beta 1 with a broken platform wouldn't be great.

@bruvzg @stuartcarnie Would you be able to work on a fix today?
I'm checking it right now.

Fix patch:
diff --git a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
index 1975bde18527..040f7c6c898a 100644
--- a/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
+++ b/misc/dist/ios_xcode/godot_ios.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+        054F8BE62D38852F00B81423 /* MetalFX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 054F8BE52D38852F00B81423 /* MetalFX.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
 		1F1575721F582BE20003B888 /* dylibs in Resources */ = {isa = PBXBuildFile; fileRef = 1F1575711F582BE20003B888 /* dylibs */; };
 		DEADBEEF2F582BE20003B888 /* $binary.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEADBEEF1F582BE20003B888 /* $binary.xcframework */; };
 		$modules_buildfile
@@ -42,6 +43,7 @@
 		1FF4C1881F584E6300A41E41 /* $binary.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "$binary.entitlements"; sourceTree = "<group>"; };
 		1FF8DBB01FBA9DE1009DE660 /* dummy.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = dummy.cpp; sourceTree = "<group>"; };
 		9039D3BD24C093AC0020482C /* MoltenVK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MoltenVK; path = MoltenVK.xcframework; sourceTree = "<group>"; };
+		054F8BE52D38852F00B81423 /* MetalFX.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MetalFX.framework; path = System/Library/Frameworks/MetalFX.framework; sourceTree = SDKROOT; };
 		D07CD44D1C5D589C00B7FB28 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
 		D0BCFE3418AEBDA2004A7AAE /* $binary.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "$binary.app"; sourceTree = BUILT_PRODUCTS_DIR; };
 		D0BCFE4318AEBDA2004A7AAE /* $binary-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "$binary-Info.plist"; sourceTree = "<group>"; };
@@ -60,6 +62,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				9039D3BE24C093AC0020482C /* MoltenVK.xcframework in Frameworks */,
+				054F8BE62D38852F00B81423 /* MetalFX.framework in Frameworks */,
 				DEADBEEF2F582BE20003B888 /* $binary.xcframework */,
 				$modules_buildphase
 				$additional_pbx_frameworks_build
@@ -94,6 +97,7 @@
 			isa = PBXGroup;
 			children = (
 				9039D3BD24C093AC0020482C /* MoltenVK.xcframework */,
+				054F8BE52D38852F00B81423 /* MetalFX.framework */,
 				DEADBEEF1F582BE20003B888 /* $binary.xcframework */,
 				$modules_buildgrp
 				$additional_pbx_frameworks_refs


Test patch: