diff options
Diffstat (limited to 'platform/macos/os_macos.mm')
-rw-r--r-- | platform/macos/os_macos.mm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm index 9f0bea5951..d9086b8c38 100644 --- a/platform/macos/os_macos.mm +++ b/platform/macos/os_macos.mm @@ -230,7 +230,10 @@ Error OS_MacOS::open_dynamic_library(const String &p_path, void *&p_library_hand path = get_framework_executable(get_executable_path().get_base_dir().path_join("../Frameworks").path_join(p_path.get_file())); } - ERR_FAIL_COND_V(!FileAccess::exists(path), ERR_FILE_NOT_FOUND); + if (!FileAccess::exists(path)) { + // Try using path as is. macOS system libraries with `/usr/lib/*` path do not exist as physical files and are loaded from shared cache. + path = p_path; + } p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW); ERR_FAIL_NULL_V_MSG(p_library_handle, ERR_CANT_OPEN, vformat("Can't open dynamic library: %s. Error: %s.", p_path, dlerror())); @@ -666,6 +669,15 @@ Error OS_MacOS::create_instance(const List<String> &p_arguments, ProcessID *r_ch } } +bool OS_MacOS::is_process_running(const ProcessID &p_pid) const { + NSRunningApplication *app = [NSRunningApplication runningApplicationWithProcessIdentifier:(pid_t)p_pid]; + if (!app) { + return OS_Unix::is_process_running(p_pid); + } + + return ![app isTerminated]; +} + String OS_MacOS::get_unique_id() const { static String serial_number; |