mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 22:14:34 +00:00
Cocoa: Fix search path for private Vulkan loader
According to both Apple and LunarG, a private copy of the macOS Vulkan loader libvulkan.1.dylib should be placed in the Frameworks directory of the bundle and not its main executable directory. This commit updates the dynamic loading path accordingly. Fixes #2113 Closes #2120
This commit is contained in:
parent
3b3d58df47
commit
9b7713cf92
@ -460,11 +460,18 @@ void* _glfwLoadLocalVulkanLoaderCocoa(void)
|
|||||||
if (!bundle)
|
if (!bundle)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
CFURLRef url =
|
CFURLRef frameworksUrl = CFBundleCopyPrivateFrameworksURL(bundle);
|
||||||
CFBundleCopyAuxiliaryExecutableURL(bundle, CFSTR("libvulkan.1.dylib"));
|
if (!frameworksUrl)
|
||||||
if (!url)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
CFURLRef url = CFURLCreateCopyAppendingPathComponent(
|
||||||
|
kCFAllocatorDefault, frameworksUrl, CFSTR("libvulkan.1.dylib"), false);
|
||||||
|
if (!url)
|
||||||
|
{
|
||||||
|
CFRelease(frameworksUrl);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
void* handle = NULL;
|
void* handle = NULL;
|
||||||
|
|
||||||
@ -472,6 +479,7 @@ void* _glfwLoadLocalVulkanLoaderCocoa(void)
|
|||||||
handle = _glfwPlatformLoadModule(path);
|
handle = _glfwPlatformLoadModule(path);
|
||||||
|
|
||||||
CFRelease(url);
|
CFRelease(url);
|
||||||
|
CFRelease(frameworksUrl);
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user