Skip to content

Commit ebbdf4a

Browse files
committed
Merge branch 'main' into feature/modularize-samples
2 parents 1fb80d1 + 9be769c commit ebbdf4a

3 files changed

Lines changed: 29 additions & 23 deletions

File tree

generator/snippets/DynamicLoader.hpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@
3131
{
3232
m_library = dlopen( "libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL );
3333
}
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+
}
4040
// for Homebrew installations on Apple Silicon
4141
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+
}
4555
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__ )
6060
m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL );
6161
if ( !m_library )
6262
{

generator/snippets/includes.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
# include <string.h> // strnlen
1313
# include <string> // std::string
1414
# include <utility> // std::exchange
15+
# if defined( __APPLE__ )
16+
# include <cstdlib> // std::getenv
17+
# endif
1518
# if 17 <= VULKAN_HPP_CPP_VERSION
1619
# include <string_view>
1720
# endif

vulkan/vulkan.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
# include <string.h> // strnlen
1919
# include <string> // std::string
2020
# include <utility> // std::exchange
21+
# if defined( __APPLE__ )
22+
# include <cstdlib> // std::getenv
23+
# endif
2124
# if 17 <= VULKAN_HPP_CPP_VERSION
2225
# include <string_view>
2326
# endif

0 commit comments

Comments
 (0)