diff options
author | Naoto Kondo <cgigcp3yqt@gmail.com> | 2018-10-28 00:58:04 +0900 |
---|---|---|
committer | Naoto Kondo <cgigcp3yqt@gmail.com> | 2018-10-28 23:57:51 +0900 |
commit | 63cba9ba627c9d7e1d167600006cf3358dfee345 (patch) | |
tree | 484f9a884cd426c5a56e3685dd5a5942ea7ba5d2 /modules/gdnative | |
parent | 970b58148f579f741934f64af437d01b985df15d (diff) |
GDNative: Fixes a problem that active_library_path is wrong after exporting app for mac
Diffstat (limited to 'modules/gdnative')
-rw-r--r-- | modules/gdnative/gdnative.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index ecde73ae1c..283e9b3bc8 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -306,6 +306,13 @@ bool GDNative::initialize() { #elif defined(UWP_ENABLED) // On UWP we use a relative path from the app String path = lib_path.replace("res://", ""); +#elif defined(OSX_ENABLED) + // On OSX the exported libraries are located under the Frameworks directory. + // So we need to replace the library path. + String path = ProjectSettings::get_singleton()->globalize_path(lib_path); + if (!FileAccess::exists(path)) { + path = OS::get_singleton()->get_executable_path().get_base_dir().plus_file("../Frameworks").plus_file(lib_path.get_file()); + } #else String path = ProjectSettings::get_singleton()->globalize_path(lib_path); #endif |