Update which backends are enabled by default

This changes the Vulkan backend to be enabled by default on Windows and
Linux as well as changes the OpenGL backend to be disabled by default on
OSX.
This commit is contained in:
Corentin Wallez 2018-08-01 18:18:48 +02:00 committed by Corentin Wallez
parent 0a17aa751d
commit f9f44ae289
2 changed files with 10 additions and 6 deletions

View File

@ -58,14 +58,11 @@ script:
# Use the more recent compilers we just installed # Use the more recent compilers we just installed
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$CXX" == "clang++" ]; then export CXX="clang++-5.0" CC="clang-5.0"; fi - if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$CXX" == "clang++" ]; then export CXX="clang++-5.0" CC="clang-5.0"; fi
# Build the Vulkan backend on Linux
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export BUILD_VULKAN=1; else export BUILD_VULKAN=0; fi
# Build # Build
- mkdir -p build - mkdir -p build
- cd build - cd build
- cmake --version - cmake --version
- cmake -G "Ninja" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDAWN_USE_WERROR=1 -DDAWN_ENABLE_VULKAN=$BUILD_VULKAN .. - cmake -G "Ninja" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DDAWN_USE_WERROR=1 ..
- cmake --build . - cmake --build .
# Test # Test

View File

@ -40,17 +40,24 @@ option(DAWN_USE_WERROR "Treat warnings as error (useful for CI)" 0)
# Default values for the backend-enabling options # Default values for the backend-enabling options
set(ENABLE_D3D12 OFF) set(ENABLE_D3D12 OFF)
set(ENABLE_METAL OFF) set(ENABLE_METAL OFF)
set(ENABLE_OPENGL OFF)
set(ENABLE_VULKAN OFF)
if (WIN32) if (WIN32)
set(ENABLE_D3D12 ON) set(ENABLE_D3D12 ON)
set(ENABLE_OPENGL ON)
set(ENABLE_VULKAN ON)
elseif(APPLE) elseif(APPLE)
set(ENABLE_METAL ON) set(ENABLE_METAL ON)
elseif(UNIX)
set(ENABLE_OPENGL ON)
set(ENABLE_VULKAN ON)
endif() endif()
option(DAWN_ENABLE_D3D12 "Enable compilation of the D3D12 backend" ${ENABLE_D3D12}) option(DAWN_ENABLE_D3D12 "Enable compilation of the D3D12 backend" ${ENABLE_D3D12})
option(DAWN_ENABLE_METAL "Enable compilation of the Metal backend" ${ENABLE_METAL}) option(DAWN_ENABLE_METAL "Enable compilation of the Metal backend" ${ENABLE_METAL})
option(DAWN_ENABLE_NULL "Enable compilation of the Null backend" ON) option(DAWN_ENABLE_NULL "Enable compilation of the Null backend" ON)
option(DAWN_ENABLE_OPENGL "Enable compilation of the OpenGL backend" ON) option(DAWN_ENABLE_OPENGL "Enable compilation of the OpenGL backend" ${ENABLE_OPENGL})
option(DAWN_ENABLE_VULKAN "Enable compilation of the Vulkan backend" OFF) option(DAWN_ENABLE_VULKAN "Enable compilation of the Vulkan backend" ${ENABLE_VULKAN})
option(DAWN_ALWAYS_ASSERT "Enable assertions on all build types" OFF) option(DAWN_ALWAYS_ASSERT "Enable assertions on all build types" OFF)
option(DAWN_USE_CPP17 "Use some optional C++17 features for compile-time checks" OFF) option(DAWN_USE_CPP17 "Use some optional C++17 features for compile-time checks" OFF)