summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-26 13:43:34 +0200
committerGitHub <noreply@github.com>2020-07-26 13:43:34 +0200
commit42d320beca9c33f8bd54392296be2d133d671e9e (patch)
tree91beccbd09445fb702b24fb7852d848655f1b519
parent9856c8fda45c080886603515320faec4858d46dd (diff)
parent3b340985cc36839e36429d46e53b8a99b3656704 (diff)
Merge pull request #40719 from akien-mga/scons-vulkan-system
SCons: Support linking system Vulkan loader while using vendored VMA
-rw-r--r--drivers/vulkan/SCsub11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/vulkan/SCsub b/drivers/vulkan/SCsub
index 436f513d72..61d91711da 100644
--- a/drivers/vulkan/SCsub
+++ b/drivers/vulkan/SCsub
@@ -4,6 +4,7 @@ Import("env")
env.add_source_files(env.drivers_sources, "*.cpp")
+# FIXME: Refactor all this to reduce code duplication.
if env["platform"] == "android":
# Use NDK Vulkan headers
thirdparty_dir = env["ANDROID_NDK_ROOT"] + "/sources/third_party/vulkan/src"
@@ -100,3 +101,13 @@ elif env["builtin_vulkan"]:
loader_sources = [thirdparty_dir + "/loader/" + file for file in loader_sources]
env_thirdparty.add_source_files(env.drivers_sources, loader_sources)
env_thirdparty.add_source_files(env.drivers_sources, vma_sources)
+else: # Always build VMA.
+ thirdparty_dir = "#thirdparty/vulkan"
+ env.Prepend(CPPPATH=[thirdparty_dir])
+
+ # Build Vulkan loader library
+ env_thirdparty = env.Clone()
+ env_thirdparty.disable_warnings()
+ vma_sources = [thirdparty_dir + "/vk_mem_alloc.cpp"]
+
+ env_thirdparty.add_source_files(env.drivers_sources, vma_sources)