diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2019-07-29 20:44:14 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-11 11:57:40 +0100 | 
| commit | 6289e7d1479f6e7c9e55890c8c66d2e5e0a1481a (patch) | |
| tree | 8223d907b1aa8184295240a7b6f63023da05c02f /platform/osx/detect.py | |
| parent | 6ecedd1e6ca7d8b10b13a3dab19074fd51b17bcf (diff) | |
| parent | b456bfad5cee3922f55621bf7c133cc67337636a (diff) | |
Merge pull request #29993 from bruvzg/vulkan
Initial Vulkan support for macOS (MoltenVK) and Windows
Diffstat (limited to 'platform/osx/detect.py')
| -rw-r--r-- | platform/osx/detect.py | 23 | 
1 files changed, 18 insertions, 5 deletions
diff --git a/platform/osx/detect.py b/platform/osx/detect.py index fe839199e8..c4e8779523 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -1,5 +1,6 @@  import os  import sys +import subprocess  from methods import detect_darwin_sdk_path @@ -25,6 +26,7 @@ def get_opts():      return [          ('osxcross_sdk', 'OSXCross SDK version', 'darwin14'),          ('MACOS_SDK_PATH', 'Path to the macOS SDK', ''), +        BoolVariable('use_static_mvk', 'Link MoltenVK statically as Level-0 driver (better portability) or use Vulkan ICD loader (enables validation layers)', False),          EnumVariable('debug_symbols', 'Add debugging symbols to release builds', 'yes', ('yes', 'no', 'full')),          BoolVariable('separate_debug_symbols', 'Create a separate file containing debugging symbols', False),          BoolVariable('use_ubsan', 'Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)', False), @@ -148,9 +150,20 @@ def configure(env):      ## Flags      env.Prepend(CPPPATH=['#platform/osx']) -    env.Append(CPPDEFINES=['OSX_ENABLED', 'UNIX_ENABLED', 'GLES_ENABLED', 'APPLE_STYLE_KEYS', 'COREAUDIO_ENABLED', 'COREMIDI_ENABLED']) -    env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit', '-framework', 'CoreAudio', '-framework', 'CoreMIDI', '-lz', '-framework', 'IOKit', '-framework', 'ForceFeedback', '-framework', 'AVFoundation', '-framework', 'CoreMedia', '-framework', 'CoreVideo']) -    env.Append(LIBS=['pthread']) +    env.Append(CPPDEFINES=['OSX_ENABLED', 'UNIX_ENABLED', 'APPLE_STYLE_KEYS', 'COREAUDIO_ENABLED', 'COREMIDI_ENABLED']) +    env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'AudioUnit', '-framework', 'CoreAudio', '-framework', 'CoreMIDI', '-framework', 'IOKit', '-framework', 'ForceFeedback', '-framework', 'CoreVideo', '-framework', 'AVFoundation', '-framework', 'CoreMedia']) +    env.Append(LIBS=['pthread', 'z']) -    env.Append(CCFLAGS=['-mmacosx-version-min=10.9']) -    env.Append(LINKFLAGS=['-mmacosx-version-min=10.9']) +    env.Prepend(CPPPATH=['#thirdparty/vulkan/include/', "#thirdparty/vulkan/registry/"]) +    env.Append(CPPDEFINES=['VULKAN_ENABLED']) + +    #env.Append(CPPDEFINES=['GLES_ENABLED', 'OPENGL_ENABLED']) + +    env.Append(LINKFLAGS=['-framework', 'Metal', '-framework', 'QuartzCore', '-framework', 'IOSurface']) +    if (env['use_static_mvk']): +        env.Append(LINKFLAGS=['-framework', 'MoltenVK']) +    elif not env["builtin_vulkan_loader"]: +        env.Append(LIBS=['vulkan']) + +    env.Append(CCFLAGS=['-mmacosx-version-min=10.11']) +    env.Append(LINKFLAGS=['-mmacosx-version-min=10.11'])  |