diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2019-08-05 11:48:54 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-02-11 11:59:04 +0100 |
| commit | 511f65214fcc95011525e2f23e4d1be7cd7b8731 (patch) | |
| tree | b9ab281613cc08c3a41767a5e342fadc85821178 /drivers | |
| parent | 324082471de5e923fe8d03e43085ea52e1f117e4 (diff) | |
| download | redot-engine-511f65214fcc95011525e2f23e4d1be7cd7b8731.tar.gz | |
SCons: Streamline Vulkan buildsystem + fixups
- Renamed option to `builtin_vulkan`, since that's the name of the
library and if we were to add new components, we'd likely use that
same option.
- Merge `vulkan_loader/SCsub` in `vulkan/SCsub`.
- Accordingly, don't use built-in Vulkan headers when not building
against the built-in loader library.
- Drop Vulkan registry which we don't appear to need currently.
- Style and permission fixes.
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/SCsub | 3 | ||||
| -rw-r--r-- | drivers/vulkan/SCsub | 57 | ||||
| -rw-r--r-- | drivers/vulkan_loader/SCsub | 55 |
3 files changed, 55 insertions, 60 deletions
diff --git a/drivers/SCsub b/drivers/SCsub index 29f3c30325..48befd213c 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -22,9 +22,6 @@ SConscript('alsamidi/SCsub') SConscript('coremidi/SCsub') SConscript('winmidi/SCsub') -if env["builtin_vulkan_loader"] and not (env["platform"]=="osx" and env['use_static_mvk']): - SConscript('vulkan_loader/SCsub') - # Graphics drivers if (env["platform"] != "server"): # SConscript('gles3/SCsub') diff --git a/drivers/vulkan/SCsub b/drivers/vulkan/SCsub index 2251181704..377f4c95b4 100644 --- a/drivers/vulkan/SCsub +++ b/drivers/vulkan/SCsub @@ -2,7 +2,60 @@ Import('env') -env.add_source_files(env.drivers_sources,"*.cpp") +env.add_source_files(env.drivers_sources, "*.cpp") +if env['builtin_vulkan']: + # Use bundled Vulkan headers + thirdparty_dir = "#thirdparty/vulkan" + env.Prepend(CPPPATH=[thirdparty_dir + "/include", thirdparty_dir + "/loader"]) -#SConscript("shaders/SCsub") + # Build Vulkan loader library + env_thirdparty = env.Clone() + env_thirdparty.disable_warnings() + + loader_sources = [ + "asm_offset.c", + "cJSON.c", + "debug_utils.c", + "dev_ext_trampoline.c", + "loader.c", + "murmurhash.c", + "phys_dev_ext.c", + "trampoline.c", + "unknown_ext_chain.c", + "wsi.c", + "extension_manual.c", + ] + + if env['platform'] == "windows": + loader_sources.append("dirent_on_windows.c") + env_thirdparty.AppendUnique(CPPDEFINES=[ + 'VK_USE_PLATFORM_WIN32_KHR', + 'VULKAN_NON_CMAKE_BUILD', + 'WIN32_LEAN_AND_MEAN', + 'API_NAME=\\"%s\\"' % 'Vulkan' + ]) + if not env.msvc: # Windows 7+, missing in mingw headers + env_thirdparty.AppendUnique(CPPDEFINES=[ + "CM_GETIDLIST_FILTER_CLASS=0x00000200", + "CM_GETIDLIST_FILTER_PRESENT=0x00000100" + ]) + elif env['platform'] == "osx": + env_thirdparty.AppendUnique(CPPDEFINES=[ + 'VK_USE_PLATFORM_MACOS_MVK', + 'VULKAN_NON_CMAKE_BUILD', + 'SYSCONFDIR=\\"%s\\"' % '/etc', + 'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share', + 'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg' + ]) + elif env['platform'] == "x11": + env_thirdparty.AppendUnique(CPPDEFINES=[ + 'VK_USE_PLATFORM_XLIB_KHR', + 'VULKAN_NON_CMAKE_BUILD', + 'SYSCONFDIR=\\"%s\\"' % '/etc', + 'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share', + 'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg' + ]) + + loader_sources = [thirdparty_dir + "/loader/" + file for file in loader_sources] + env_thirdparty.add_source_files(env.drivers_sources, loader_sources) diff --git a/drivers/vulkan_loader/SCsub b/drivers/vulkan_loader/SCsub deleted file mode 100644 index 2a4cc2928e..0000000000 --- a/drivers/vulkan_loader/SCsub +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python - -Import('env') - -env_vlk_ldr = env.Clone() -loader_dir = "#thirdparty/vulkan/loader/" -loader_sources = [ - "asm_offset.c", - "dev_ext_trampoline.c", - "phys_dev_ext.c", - "cJSON.c", - "loader.c", - "trampoline.c", - "unknown_ext_chain.c", - "wsi.c", - "debug_utils.c", - "extension_manual.c", - "murmurhash.c" -] - -if (env_vlk_ldr["platform"]=="windows"): - loader_sources.append("dirent_on_windows.c") - env_vlk_ldr.AppendUnique(CPPDEFINES = [ - 'VK_USE_PLATFORM_WIN32_KHR', - 'VULKAN_NON_CMAKE_BUILD', - 'WIN32_LEAN_AND_MEAN', - 'API_NAME=\\"%s\\"' % 'Vulkan' - ]) - if not env.msvc: #windows 7+, missing in mingw headers - env_vlk_ldr.AppendUnique(CPPDEFINES = [ - "CM_GETIDLIST_FILTER_CLASS=0x00000200", - "CM_GETIDLIST_FILTER_PRESENT=0x00000100" - ]) -elif (env_vlk_ldr["platform"]=="osx"): - env_vlk_ldr.AppendUnique(CPPDEFINES = [ - 'VK_USE_PLATFORM_MACOS_MVK', - 'VULKAN_NON_CMAKE_BUILD', - 'SYSCONFDIR=\\"%s\\"' % '/etc', - 'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share', - 'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg' - ]) -elif (env_vlk_ldr["platform"]=="x11"): - env_vlk_ldr.AppendUnique(CPPDEFINES = [ - 'VK_USE_PLATFORM_XLIB_KHR', - 'VULKAN_NON_CMAKE_BUILD', - 'SYSCONFDIR=\\"%s\\"' % '/etc', - 'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share', - 'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg' - ]) -loader_sources = [loader_dir + file for file in loader_sources] - -env_thirdparty = env_vlk_ldr.Clone() -env_thirdparty.add_source_files(env.drivers_sources, loader_sources) - -env.Prepend(CPPPATH=[loader_dir]) |
