diff --git a/.travis.yml b/.travis.yml index 0e5a9df350..f91ad297a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,14 +58,11 @@ script: # 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 - # Build the Vulkan backend on Linux - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export BUILD_VULKAN=1; else export BUILD_VULKAN=0; fi - # Build - mkdir -p build - cd build - 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 . # Test diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c62310288..513ce07202 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,17 +40,24 @@ option(DAWN_USE_WERROR "Treat warnings as error (useful for CI)" 0) # Default values for the backend-enabling options set(ENABLE_D3D12 OFF) set(ENABLE_METAL OFF) +set(ENABLE_OPENGL OFF) +set(ENABLE_VULKAN OFF) if (WIN32) set(ENABLE_D3D12 ON) + set(ENABLE_OPENGL ON) + set(ENABLE_VULKAN ON) elseif(APPLE) set(ENABLE_METAL ON) +elseif(UNIX) + set(ENABLE_OPENGL ON) + set(ENABLE_VULKAN ON) endif() 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_NULL "Enable compilation of the Null backend" ON) -option(DAWN_ENABLE_OPENGL "Enable compilation of the OpenGL backend" ON) -option(DAWN_ENABLE_VULKAN "Enable compilation of the Vulkan backend" OFF) +option(DAWN_ENABLE_OPENGL "Enable compilation of the OpenGL backend" ${ENABLE_OPENGL}) +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_USE_CPP17 "Use some optional C++17 features for compile-time checks" OFF)