|
31 | 31 | { |
32 | 32 | m_library = dlopen( "libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL ); |
33 | 33 | } |
34 | | - // modern versions of macOS don't search /usr/local/lib automatically contrary to what man dlopen says |
35 | | - // Vulkan SDK uses this as the system-wide installation location, so we're going to fallback to this if all else fails |
36 | | - if ( !m_library && ( std::getenv("DYLD_FALLBACK_LIBRARY_PATH") == NULL ) ) |
37 | | - { |
38 | | - m_library = dlopen( "/usr/local/lib/libvulkan.dylib", RTLD_NOW | RTLD_LOCAL ); |
39 | | - } |
| 34 | + // modern versions of macOS don't search /usr/local/lib automatically contrary to what man dlopen says |
| 35 | + // Vulkan SDK uses this as the system-wide installation location, so we're going to fallback to this if all else fails |
| 36 | + if ( !m_library && ( std::getenv( "DYLD_FALLBACK_LIBRARY_PATH" ) == NULL ) ) |
| 37 | + { |
| 38 | + m_library = dlopen( "/usr/local/lib/libvulkan.dylib", RTLD_NOW | RTLD_LOCAL ); |
| 39 | + } |
40 | 40 | // for Homebrew installations on Apple Silicon |
41 | 41 | if ( !m_library ) |
42 | | - { |
43 | | - m_library = dlopen( "/opt/homebrew/lib/libvulkan.dylib", RTLD_NOW | RTLD_LOCAL ); |
44 | | - } |
| 42 | + { |
| 43 | + m_library = dlopen( "/opt/homebrew/lib/libvulkan.dylib", RTLD_NOW | RTLD_LOCAL ); |
| 44 | + } |
| 45 | + if ( !m_library ) |
| 46 | + { |
| 47 | + m_library = dlopen( "libMoltenVK.dylib", RTLD_NOW | RTLD_LOCAL ); |
| 48 | + } |
| 49 | + // Add support for using Vulkan and MoltenVK in a Framework. App store rules for iOS |
| 50 | + // strictly enforce no .dylib's. If they aren't found it just falls through |
| 51 | + if ( !m_library ) |
| 52 | + { |
| 53 | + m_library = dlopen( "vulkan.framework/vulkan", RTLD_NOW | RTLD_LOCAL ); |
| 54 | + } |
45 | 55 | if ( !m_library ) |
46 | | - { |
47 | | - m_library = dlopen( "libMoltenVK.dylib", RTLD_NOW | RTLD_LOCAL ); |
48 | | - } |
49 | | - // Add support for using Vulkan and MoltenVK in a Framework. App store rules for iOS |
50 | | - // strictly enforce no .dylib's. If they aren't found it just falls through |
51 | | - if ( !m_library ) |
52 | | - { |
53 | | - m_library = dlopen( "vulkan.framework/vulkan", RTLD_NOW | RTLD_LOCAL ); |
54 | | - } |
55 | | - if ( !m_library ) |
56 | | - { |
57 | | - m_library = dlopen( "MoltenVK.framework/MoltenVK", RTLD_NOW | RTLD_LOCAL ); |
58 | | - } |
59 | | -# elif defined( __unix__ ) || defined( __QNX__ ) || defined(__Fuchsia__) |
| 56 | + { |
| 57 | + m_library = dlopen( "MoltenVK.framework/MoltenVK", RTLD_NOW | RTLD_LOCAL ); |
| 58 | + } |
| 59 | +# elif defined( __unix__ ) || defined( __QNX__ ) || defined( __Fuchsia__ ) |
60 | 60 | m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL ); |
61 | 61 | if ( !m_library ) |
62 | 62 | { |
|
0 commit comments