Godot Engine – Multi-platform 2D and 3D game engine
[iOS] Fix building and exporting for iOS without MoltenVK.
Pāvels Nadtočajevsed8069038ee6
diff --git a/editor/export/editor_export_platform_apple_embedded.cpp b/editor/export/editor_export_platform_apple_embedded.cppindex aaf2e339f34..6b5e0b0af30 100644--- a/editor/export/editor_export_platform_apple_embedded.cpp+++ b/editor/export/editor_export_platform_apple_embedded.cpp@@ -1938,6 +1938,11 @@ Error EditorExportPlatformAppleEmbedded::_export_project_helper(const Ref<Editor}if (String::utf8(scan_fname).begins_with("AccessKit.xcframework/")) {config_data.has_accesskit = true;+ }+ if (String::utf8(scan_fname).begins_with("MoltenVK.xcframework/")) {+ config_data.has_moltenvk = true;+ }+ if (config_data.has_accesskit && config_data.has_moltenvk) {break;}scan_ret = unzGoToNextFile(src_pkg_zip);diff --git a/editor/export/editor_export_platform_apple_embedded.h b/editor/export/editor_export_platform_apple_embedded.hindex d7e68c2e6d5..7ab5e24b3a1 100644--- a/editor/export/editor_export_platform_apple_embedded.h+++ b/editor/export/editor_export_platform_apple_embedded.h@@ -148,6 +148,7 @@ protected:String spm_package_products;Vector<String> capabilities;bool has_accesskit = false;+ bool has_moltenvk = false;};struct CodeSigningDetails {diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cppindex 42ad8c49d4b..0777b029913 100644--- a/platform/ios/export/export_plugin.cpp+++ b/platform/ios/export/export_plugin.cpp@@ -277,16 +277,16 @@ String EditorExportPlatformIOS::_process_config_file_line(const Ref<EditorExport// MoltenVK Framework} else if (p_line.contains("$moltenvk_buildfile")) {- String value = "9039D3BE24C093AC0020482C /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9039D3BD24C093AC0020482C /* MoltenVK.xcframework */; };";+ String value = p_config.has_moltenvk ? "9039D3BE24C093AC0020482C /* MoltenVK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9039D3BD24C093AC0020482C /* MoltenVK.xcframework */; };" : "";strnew += p_line.replace("$moltenvk_buildfile", value) + "\n";} else if (p_line.contains("$moltenvk_fileref")) {- String value = "9039D3BD24C093AC0020482C /* MoltenVK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MoltenVK; path = MoltenVK.xcframework; sourceTree = \"<group>\"; };";+ String value = p_config.has_moltenvk ? "9039D3BD24C093AC0020482C /* MoltenVK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = MoltenVK; path = MoltenVK.xcframework; sourceTree = \"<group>\"; };" : "";strnew += p_line.replace("$moltenvk_fileref", value) + "\n";} else if (p_line.contains("$moltenvk_buildphase")) {- String value = "9039D3BE24C093AC0020482C /* MoltenVK.xcframework in Frameworks */,";+ String value = p_config.has_moltenvk ? "9039D3BE24C093AC0020482C /* MoltenVK.xcframework in Frameworks */," : "";strnew += p_line.replace("$moltenvk_buildphase", value) + "\n";} else if (p_line.contains("$moltenvk_buildgrp")) {- String value = "9039D3BD24C093AC0020482C /* MoltenVK.xcframework */,";+ String value = p_config.has_moltenvk ? "9039D3BD24C093AC0020482C /* MoltenVK.xcframework */," : "";strnew += p_line.replace("$moltenvk_buildgrp", value) + "\n";// Launch Storyboarddiff --git a/platform/ios/platform_ios_builders.py b/platform/ios/platform_ios_builders.pyindex b2fe090969b..a1be69161f0 100644--- a/platform/ios/platform_ios_builders.py+++ b/platform/ios/platform_ios_builders.py@@ -4,4 +4,4 @@ from platform_methods import generate_bundle_apple_embeddeddef generate_bundle(target, source, env):- generate_bundle_apple_embedded("ios", "ios-arm64", "ios-arm64_x86_64-simulator", True, target, source, env)+ generate_bundle_apple_embedded("ios", "ios-arm64", "ios-arm64_x86_64-simulator", env["vulkan"], target, source, env)