diff options
Diffstat (limited to 'modules/mono/mono_gd/gd_mono.cpp')
| -rw-r--r-- | modules/mono/mono_gd/gd_mono.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 247968e251..23f2f2ff13 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -322,7 +322,7 @@ godot_plugins_initialize_fn try_load_native_aot_library(void *&r_aot_dll_handle) #if defined(WINDOWS_ENABLED) String native_aot_so_path = GodotSharpDirs::get_api_assemblies_dir().path_join(assembly_name + ".dll"); -#elif defined(MACOS_ENABLED) +#elif defined(MACOS_ENABLED) || defined(IOS_ENABLED) String native_aot_so_path = GodotSharpDirs::get_api_assemblies_dir().path_join(assembly_name + ".dylib"); #elif defined(UNIX_ENABLED) String native_aot_so_path = GodotSharpDirs::get_api_assemblies_dir().path_join(assembly_name + ".so"); @@ -330,23 +330,19 @@ godot_plugins_initialize_fn try_load_native_aot_library(void *&r_aot_dll_handle) #error "Platform not supported (yet?)" #endif - if (FileAccess::exists(native_aot_so_path)) { - Error err = OS::get_singleton()->open_dynamic_library(native_aot_so_path, r_aot_dll_handle); - - if (err != OK) { - return nullptr; - } + Error err = OS::get_singleton()->open_dynamic_library(native_aot_so_path, r_aot_dll_handle); - void *lib = r_aot_dll_handle; + if (err != OK) { + return nullptr; + } - void *symbol = nullptr; + void *lib = r_aot_dll_handle; - err = OS::get_singleton()->get_dynamic_library_symbol_handle(lib, "godotsharp_game_main_init", symbol); - ERR_FAIL_COND_V(err != OK, nullptr); - return (godot_plugins_initialize_fn)symbol; - } + void *symbol = nullptr; - return nullptr; + err = OS::get_singleton()->get_dynamic_library_symbol_handle(lib, "godotsharp_game_main_init", symbol); + ERR_FAIL_COND_V(err != OK, nullptr); + return (godot_plugins_initialize_fn)symbol; } #endif @@ -376,11 +372,13 @@ void GDMono::initialize() { godot_plugins_initialize_fn godot_plugins_initialize = nullptr; +#if !defined(IOS_ENABLED) // Check that the .NET assemblies directory exists before trying to use it. if (!DirAccess::exists(GodotSharpDirs::get_api_assemblies_dir())) { OS::get_singleton()->alert(vformat(RTR("Unable to find the .NET assemblies directory.\nMake sure the '%s' directory exists and contains the .NET assemblies."), GodotSharpDirs::get_api_assemblies_dir()), RTR(".NET assemblies not found")); ERR_FAIL_MSG(".NET: Assemblies not found"); } +#endif if (!load_hostfxr(hostfxr_dll_handle)) { #if !defined(TOOLS_ENABLED) |
