diff --git a/Cargo.toml b/Cargo.toml index cf2d113..97e52a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ license = "GPL-3.0-only" [dependencies] env_logger = "0.10.0" -fork = "0.1" lazy_static = "1.4.0" log = "0.4.20" notify = "6.1.1" @@ -38,6 +37,9 @@ features = ["tokio", "winit", "wgpu"] [dependencies.systemicons] git = "https://github.com/jackpot51/systemicons" +[target.'cfg(unix)'.dependencies] +fork = "0.1" + [features] default = ["rfd"] diff --git a/src/main.rs b/src/main.rs index 81863ee..0052702 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,6 +60,7 @@ lazy_static::lazy_static! { } fn main() -> Result<(), Box> { + #[cfg(unix)] match fork::daemon(true, true) { Ok(fork::Fork::Child) => (), Ok(fork::Fork::Parent(_child_pid)) => process::exit(0),