summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2020-04-10 10:32:11 +0200
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2020-04-10 11:06:11 +0200
commit802bbe87adc52daa92ddd963e498c6c5ab845bfc (patch)
treeed18d6d6f3ee68d954dbed2d8cdd8b9da951c29b
parent74d432117239d07d497bea5368600acee5ef5af4 (diff)
Fix extra warnings in Android build
-rw-r--r--.travis.yml2
-rw-r--r--drivers/vulkan/SCsub8
-rw-r--r--platform/android/vulkan/vulkan_context_android.cpp8
-rw-r--r--thirdparty/vulkan/android/vk_mem_alloc.cpp8
4 files changed, 17 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml
index 9a16dbc19b..8cfd7a1a7f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -57,7 +57,7 @@ matrix:
- name: Android export template (release_debug, Clang)
stage: build
- env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="werror=yes"
+ env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
os: linux
compiler: clang
addons:
diff --git a/drivers/vulkan/SCsub b/drivers/vulkan/SCsub
index 35c2d61530..91d0e42f80 100644
--- a/drivers/vulkan/SCsub
+++ b/drivers/vulkan/SCsub
@@ -14,6 +14,14 @@ if env["platform"] == "android":
thirdparty_dir + "/layers/generated",
]
env.Prepend(CPPPATH=thirdparty_includes)
+
+ # Build Vulkan memory allocator
+ env_thirdparty = env.Clone()
+ env_thirdparty.disable_warnings()
+
+ thirdparty_dir = "#thirdparty/vulkan"
+ vma_sources = [thirdparty_dir + "/android/vk_mem_alloc.cpp"]
+ env_thirdparty.add_source_files(env.drivers_sources, vma_sources)
elif env["builtin_vulkan"]:
# Use bundled Vulkan headers
thirdparty_dir = "#thirdparty/vulkan"
diff --git a/platform/android/vulkan/vulkan_context_android.cpp b/platform/android/vulkan/vulkan_context_android.cpp
index b238f849fc..5fb7a83da4 100644
--- a/platform/android/vulkan/vulkan_context_android.cpp
+++ b/platform/android/vulkan/vulkan_context_android.cpp
@@ -31,14 +31,6 @@
#include "vulkan_context_android.h"
#include <vulkan/vulkan_android.h>
-#define VMA_IMPLEMENTATION
-#ifdef DEBUG_ENABLED
-#ifndef _DEBUG
-#define _DEBUG
-#endif
-#endif
-#include <vk_mem_alloc.h>
-
const char *VulkanContextAndroid::_get_platform_surface_extension() const {
return VK_KHR_ANDROID_SURFACE_EXTENSION_NAME;
}
diff --git a/thirdparty/vulkan/android/vk_mem_alloc.cpp b/thirdparty/vulkan/android/vk_mem_alloc.cpp
new file mode 100644
index 0000000000..a28454cf6e
--- /dev/null
+++ b/thirdparty/vulkan/android/vk_mem_alloc.cpp
@@ -0,0 +1,8 @@
+#define VMA_IMPLEMENTATION
+#ifdef DEBUG_ENABLED
+#ifndef _DEBUG
+#define _DEBUG
+#endif
+#endif
+// Include memory allocator from Android NDK
+#include <vk_mem_alloc.h>