aboutsummaryrefslogtreecommitdiff
path: root/third_party
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2019-03-07 15:44:31 -0500
committerGitHub <noreply@github.com>2019-03-07 15:44:31 -0500
commit0d744484eba498e30ad02cfb91b35426df470ece (patch)
tree15e738f15a7c5e4f33a37b538700831bdadcdaa5 /third_party
parent6d37d69d4cde35d95f8420e879d1fa6543e4ff1c (diff)
downloadamber-0d744484eba498e30ad02cfb91b35426df470ece.tar.gz
Build with local vulkan data if requested (#319)
This CL adds a flag AMBER_USE_LOCAL_VULKAN which if set when running cmake will have amber use the vulkan header and loaders out of the third_party directory. This should let amber try to build on a system without vulkan so the build can be tested on the bots.
Diffstat (limited to 'third_party')
-rw-r--r--third_party/CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index 6e29dde..7020678 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -142,6 +142,10 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-Wno-weak-vtables
-Wno-zero-as-null-pointer-constant
)
+
+ set(VULKAN_LOADER_BUILD_FIXES
+ -Wno-unknown-warning-option
+ )
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@@ -164,6 +168,8 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(SHADERC_BUILD_FIXES
-Wno-missing-field-initializers
-Wno-pedantic)
+
+ set(VULKAN_LOADER_BUILD_FIXES "")
endif()
if (MSVC)
@@ -240,6 +246,10 @@ if (MSVC)
/wd5027
/wd5039
/wd5045)
+
+ set(VULKAN_LOADER_BUILD_FIXES
+ /W3
+ )
endif()
if (${AMBER_ENABLE_TESTS})
@@ -297,3 +307,15 @@ if (${AMBER_ENABLE_SAMPLES})
add_library(lodepng STATIC ${LODEPNG_SOURCES})
endif()
+
+if (${AMBER_USE_LOCAL_VULKAN})
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/vulkan-headers)
+
+ set(CXX_BACK ${CMAKE_CXX_FLAGS})
+ SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "${VULKAN_LOADER_BUILD_FIXES}")
+ STRING(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ set(BUILD_TESTS FALSE)
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/vulkan-loader)
+ set(CMAKE_CXX_FLAGS ${CXX_BACK})
+endif()
+