Add simple Windows CI workflow check (#2663)

* Add simple Windows CI workflow check

* Fix Windows build in CI

* Windows fix
This commit is contained in:
John Hughes 2023-02-03 13:19:12 +01:00 committed by GitHub
parent 5725868b57
commit 8c59888ebd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 3 deletions

View file

@ -153,3 +153,24 @@ jobs:
uses: Swatinem/rust-cache@v2
- run: cargo check --features wgpu --target aarch64-linux-android
working-directory: crates/eframe
windows:
name: Check Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.65.0
override: true
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --all-targets --all-features

View file

@ -27,7 +27,8 @@ opt-level = 2 # fast and small wasm, basically same as `opt-level = 's'`
[profile.dev]
split-debuginfo = "unpacked" # faster debug builds on mac
# Can't leave this on by default, because it breaks the Windows build. Related: https://github.com/rust-lang/cargo/issues/4897
# split-debuginfo = "unpacked" # faster debug builds on mac
# opt-level = 1 # Make debug builds run faster
# Optimize all dependencies even in debug builds (does not affect workspace packages):

View file

@ -172,7 +172,7 @@ fn window_builder_drag_and_drop(
enable: bool,
) -> winit::window::WindowBuilder {
use winit::platform::windows::WindowBuilderExtWindows as _;
build_window.with_drag_and_drop(enable)
window_builder.with_drag_and_drop(enable)
}
#[cfg(not(target_os = "windows"))]

View file

@ -29,7 +29,7 @@ impl GlutinWindowContext {
// try egl and fallback to windows wgl. Windows is the only platform that *requires* window handle to create display.
#[cfg(target_os = "windows")]
let preference = glutin::display::DisplayApiPreference::EglThenWgl(Some(window_handle));
let preference = glutin::display::DisplayApiPreference::EglThenWgl(Some(raw_window_handle));
// try egl and fallback to x11 glx
#[cfg(target_os = "linux")]
let preference = glutin::display::DisplayApiPreference::EglThenGlx(Box::new(