diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-04-27 19:04:12 +0300 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2023-05-12 12:06:59 +0200 |
commit | ebaf3cc9abb66bb4060c1b90311e237b82bedc74 (patch) | |
tree | aa1c99b7abc919c7795787543670c08a57c643e6 | |
parent | 268b60ddd6843dc5468a7951b3910084cd435ae3 (diff) |
[iOS] Fix loading of GDExtension dylibs auto converted to framework.
(cherry picked from commit ad4d565ee7c16652d1c391e339f16fd6966fd21b)
-rw-r--r-- | platform/ios/os_ios.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/ios/os_ios.mm b/platform/ios/os_ios.mm index 4d2dd3c52c..ac2d40c607 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() + "."); |