diff options
| author | Robin Hübner | 2018-04-28 14:36:35 +0200 |
|---|---|---|
| committer | Your Name | 2018-05-01 22:07:02 +0200 |
| commit | 4866733a7456aa8c88a9731b4f2f1d50881f935a (patch) | |
| tree | 8e96f306fd908d4eaed5271a8bc2d045d89b6525 /drivers | |
| parent | 01e64eb247e61cb1baf7d5e264fa73397af01e87 (diff) | |
| download | godot-4866733a7456aa8c88a9731b4f2f1d50881f935a.tar.gz godot-4866733a7456aa8c88a9731b4f2f1d50881f935a.tar.zst godot-4866733a7456aa8c88a9731b4f2f1d50881f935a.zip | |
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/unix/os_unix.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index aa01f2267..dfa57a3fb 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -357,6 +357,12 @@ Error OS_Unix::open_dynamic_library(const String p_path, void *&p_library_handle String path = p_path; + if (FileAccess::exists(path) && path.is_rel_path()) { + // dlopen expects a slash, in this case a leading ./ for it to be interpreted as a relative path, + // otherwise it will end up searching various system directories for the lib instead and finally failing. + path = "./" + path; + } + if (!FileAccess::exists(path)) { //this code exists so gdnative can load .so files from within the executable path path = get_executable_path().get_base_dir().plus_file(p_path.get_file()); |
