summaryrefslogtreecommitdiffstats
path: root/platform/ios
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-04-27 23:56:36 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-04-27 23:56:36 +0200
commit390aed9f11b509b00a691c5c5e1158e080b48151 (patch)
tree6987f3733eb58f117acd75f37e435e494aa73ace /platform/ios
parentfb3d3bf0cfa203de381481ba16f71d3176521341 (diff)
parentad4d565ee7c16652d1c391e339f16fd6966fd21b (diff)
downloadredot-engine-390aed9f11b509b00a691c5c5e1158e080b48151.tar.gz
Merge pull request #76510 from bruvzg/ios_conv_lib_load
[iOS] Fix loading of GDExtension dylibs auto converted to framework.
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/os_ios.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/ios/os_ios.mm b/platform/ios/os_ios.mm
index b2f72c310f..739db419a3 100644
--- a/platform/ios/os_ios.mm
+++ b/platform/ios/os_ios.mm
@@ -240,10 +240,20 @@ Error OS_IOS::open_dynamic_library(const String p_path, void *&p_library_handle,
}
if (!FileAccess::exists(path)) {
+ // Load .dylib converted to framework from within the executable path.
+ path = get_framework_executable(get_executable_path().get_base_dir().path_join(p_path.get_file().get_basename() + ".framework"));
+ }
+
+ if (!FileAccess::exists(path)) {
// Load .dylib or framework from a standard iOS location.
path = get_framework_executable(get_executable_path().get_base_dir().path_join("Frameworks").path_join(p_path.get_file()));
}
+ if (!FileAccess::exists(path)) {
+ // Load .dylib converted to framework from a standard iOS location.
+ path = get_framework_executable(get_executable_path().get_base_dir().path_join("Frameworks").path_join(p_path.get_file().get_basename() + ".framework"));
+ }
+
p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW);
ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + p_path + ", error: " + dlerror() + ".");