diff --git a/src/cocoa_init.m b/src/cocoa_init.m index 0d323d6b..4a8ebe9c 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -475,11 +475,18 @@ void* _glfwLoadLocalVulkanLoaderNS(void) if (!bundle) return NULL; - CFURLRef url = - CFBundleCopyAuxiliaryExecutableURL(bundle, CFSTR("libvulkan.1.dylib")); - if (!url) + CFURLRef frameworksUrl = CFBundleCopyPrivateFrameworksURL(bundle); + if (!frameworksUrl) return NULL; + CFURLRef url = CFURLCreateCopyAppendingPathComponent( + kCFAllocatorDefault, frameworksUrl, CFSTR("libvulkan.1.dylib"), false); + if (!url) + { + CFRelease(frameworksUrl); + return NULL; + } + char path[PATH_MAX]; void* handle = NULL; @@ -487,6 +494,7 @@ void* _glfwLoadLocalVulkanLoaderNS(void) handle = _glfw_dlopen(path); CFRelease(url); + CFRelease(frameworksUrl); return handle; }