Fix macOS build

This commit is contained in:
DecDuck
2025-10-16 15:32:28 +11:00
parent 8ff7604502
commit aab9b2c414
4 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -9,8 +9,8 @@
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.7.0", "@tauri-apps/api": "^2.7.0",
"@tauri-apps/plugin-deep-link": "^2.4.1", "@tauri-apps/plugin-deep-link": "^2.4.1",
"@tauri-apps/plugin-dialog": "^2.3.2", "@tauri-apps/plugin-dialog": "^2.4.0",
"@tauri-apps/plugin-opener": "^2.4.0", "@tauri-apps/plugin-opener": "^2.5.0",
"@tauri-apps/plugin-os": "^2.3.0", "@tauri-apps/plugin-os": "^2.3.0",
"@tauri-apps/plugin-shell": "^2.3.0", "@tauri-apps/plugin-shell": "^2.3.0",
"pino": "^9.7.0", "pino": "^9.7.0",
@@ -27,7 +27,7 @@ impl BackupManager<'_> {
current_platform: Platform::Windows, current_platform: Platform::Windows,
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
current_platform: Platform::MacOs, current_platform: Platform::macOS,
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
current_platform: Platform::Linux, current_platform: Platform::Linux,
@@ -43,7 +43,7 @@ impl BackupManager<'_> {
&LinuxBackupManager {} as &(dyn BackupHandler + Sync + Send), &LinuxBackupManager {} as &(dyn BackupHandler + Sync + Send),
), ),
( (
(Platform::MacOs, Platform::MacOs), (Platform::macOS, Platform::macOS),
&MacBackupManager {} as &(dyn BackupHandler + Sync + Send), &MacBackupManager {} as &(dyn BackupHandler + Sync + Send),
), ),
]), ]),
+5 -5
View File
@@ -4,20 +4,20 @@ use serde::{Deserialize, Serialize};
pub enum Platform { pub enum Platform {
Windows, Windows,
Linux, Linux,
MacOs, macOS,
} }
impl Platform { impl Platform {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
pub const HOST: Platform = Self::Windows; pub const HOST: Platform = Self::Windows;
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub const HOST: Platform = Self::MacOs; pub const HOST: Platform = Self::macOS;
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
pub const HOST: Platform = Self::Linux; pub const HOST: Platform = Self::Linux;
pub fn is_case_sensitive(&self) -> bool { pub fn is_case_sensitive(&self) -> bool {
match self { match self {
Self::Windows | Self::MacOs => false, Self::Windows | Self::macOS => false,
Self::Linux => true, Self::Linux => true,
} }
} }
@@ -28,7 +28,7 @@ impl From<&str> for Platform {
match value.to_lowercase().trim() { match value.to_lowercase().trim() {
"windows" => Self::Windows, "windows" => Self::Windows,
"linux" => Self::Linux, "linux" => Self::Linux,
"mac" | "macos" => Self::MacOs, "mac" | "macos" => Self::macOS,
_ => unimplemented!(), _ => unimplemented!(),
} }
} }
@@ -39,7 +39,7 @@ impl From<whoami::Platform> for Platform {
match value { match value {
whoami::Platform::Windows => Platform::Windows, whoami::Platform::Windows => Platform::Windows,
whoami::Platform::Linux => Platform::Linux, whoami::Platform::Linux => Platform::Linux,
whoami::Platform::MacOS => Platform::MacOs, whoami::Platform::MacOS => Platform::macOS,
platform => unimplemented!("Playform {} is not supported", platform), platform => unimplemented!("Playform {} is not supported", platform),
} }
} }
@@ -54,7 +54,7 @@ impl ProcessManager<'_> {
current_platform: Platform::Windows, current_platform: Platform::Windows,
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
current_platform: Platform::MacOs, current_platform: Platform::macOS,
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
current_platform: Platform::Linux, current_platform: Platform::Linux,
@@ -72,7 +72,7 @@ impl ProcessManager<'_> {
&NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static), &NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
), ),
( (
(Platform::MacOs, Platform::MacOs), (Platform::macOS, Platform::macOS),
&NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static), &NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
), ),
( (