Fix Windows build

This commit is contained in:
Luke Street 2024-10-11 18:53:31 -06:00
parent 5a8e4cb608
commit 008c92ebd1
4 changed files with 7 additions and 4 deletions

1
Cargo.lock generated
View File

@ -2988,6 +2988,7 @@ dependencies = [
"tracing-subscriber", "tracing-subscriber",
"tracing-wasm", "tracing-wasm",
"wgpu", "wgpu",
"winapi",
] ]
[[package]] [[package]]

View File

@ -374,8 +374,7 @@ fn run_interactive(
})?; })?;
} }
loop { loop {
let has_event = event::poll(Duration::from_millis(100))?; if event::poll(Duration::from_millis(100))? {
if has_event {
match view.handle_event(&mut state, event::read()?) { match view.handle_event(&mut state, event::read()?) {
EventControlFlow::Break => break 'outer, EventControlFlow::Break => break 'outer,
EventControlFlow::Continue(r) => result = r, EventControlFlow::Continue(r) => result = r,

View File

@ -1,6 +1,6 @@
use std::{ use std::{
env::{current_dir, current_exe}, env::{current_dir, current_exe},
fs::{File, Permissions}, fs::File,
path::PathBuf, path::PathBuf,
sync::mpsc::Receiver, sync::mpsc::Receiver,
task::Waker, task::Waker,
@ -51,7 +51,7 @@ fn run_update(
#[cfg(unix)] #[cfg(unix)]
{ {
use std::{fs, os::unix::fs::PermissionsExt}; use std::{fs, os::unix::fs::PermissionsExt};
fs::set_permissions(&target_file, Permissions::from_mode(0o755))?; fs::set_permissions(&target_file, fs::Permissions::from_mode(0o755))?;
} }
tmp_dir.close()?; tmp_dir.close()?;

View File

@ -74,6 +74,9 @@ features = [
optional = true optional = true
default-features = false default-features = false
[target.'cfg(windows)'.dependencies]
winapi = "0.3"
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
exec = "0.3" exec = "0.3"