From 43e56961c42844d91c5079e4bd6dcd09c55b4471 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Tue, 19 Mar 2019 10:49:30 -0400 Subject: [PATCH] Enable windows in Travis --- .travis.yml | 37 +++++++++++++++++++++++++++++++++---- wgpu-native/src/instance.rs | 8 ++++++-- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 97b2c3532..f7704e6aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,35 @@ language: rust -rust: - - stable - - nightly + +matrix: + include: + # Linux 64bit + - os: linux + rust: stable + compiler: gcc + - os: linux + rust: nightly + compiler: gcc + # Windows 64bit + - os: windows + rust: stable + + # macOS 64bit + - env: MACOSX_DEPLOYMENT_TARGET=10.9 + os: osx + rust: stable + osx_image: xcode9 + compiler: clang + #- env: MACOSX_DEPLOYMENT_TARGET=10.9 + # os: osx + # rust: nightly + # osx_image: xcode9 + # compiler: clang + + # iPhoneOS 64bit + #- env: TARGET=aarch64-apple-ios + # os: osx + # osx_image: xcode9 + # rust: nightly branches: except: @@ -11,7 +39,8 @@ before_install: # Do not run bors builds against the nightly compiler. # We want to find out about nightly bugs, so they're done in master, but we don't block on them. - if [[ $TRAVIS_RUST_VERSION == "nightly" && $TRAVIS_BRANCH == "staging" ]]; then exit; fi + - if [[ $TRAVIS_OS_NAME == "windows" ]]; then choco install make; fi script: - cargo test - - cargo check --manifest-path wgpu-native/Cargo.toml + - if [[ $TRAVIS_OS_NAME == "osx" ]]; then (brew update && brew upgrade cmake && brew install glfw3 && cd wgpu-native && cargo build --features=local,gfx-backend-metal && cd ../examples/hello_triangle_c && mkdir build && cd build && cmake .. && make); fi diff --git a/wgpu-native/src/instance.rs b/wgpu-native/src/instance.rs index 7bb135c14..f4591b1ce 100644 --- a/wgpu-native/src/instance.rs +++ b/wgpu-native/src/instance.rs @@ -109,7 +109,11 @@ pub fn instance_create_surface_from_windows_hwnd( hinstance: *mut std::ffi::c_void, hwnd: *mut std::ffi::c_void, ) -> SurfaceHandle { - #[cfg(not(target_os = "windows"))] + #[cfg(not(any( + feature = "gfx-backend-dx11", + feature = "gfx-backend-dx12", + all(target_os = "windows", feature = "gfx-backend-vulkan"), + )))] let raw = unimplemented!(); #[cfg(any(feature = "gfx-backend-dx11", feature = "gfx-backend-dx12"))] @@ -118,7 +122,7 @@ pub fn instance_create_surface_from_windows_hwnd( #[cfg(all(target_os = "windows", feature = "gfx-backend-vulkan"))] let raw = HUB.instances.read()[instance_id].create_surface_from_hwnd(hinstance, hwnd); - #[cfg_attr(not(target_os = "windows"), allow(unreachable_code))] + #[allow(unreachable_code)] SurfaceHandle::new(raw) }