aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/main.rs
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-02-25 20:55:54 +0100
committerGitHub <noreply@github.com>2023-02-25 19:55:54 +0000
commit0928087751569148e7bbc1b351ed0eab0430dac5 (patch)
tree21f413ce5b5d40e54713c9aea47841b293014423 /src-tauri/src/main.rs
parent17c4f45a69a418bfb02134fb568caf7c9f4f20e3 (diff)
downloadFlightCore-0928087751569148e7bbc1b351ed0eab0430dac5.tar.gz
FlightCore-0928087751569148e7bbc1b351ed0eab0430dac5.zip
refactor: Properly set cfg macro for OS conditional compilation (#186)
* refactor: Properly set cfg macro for OS conditional compilation * docs: Add comment about MacOS
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r--src-tauri/src/main.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 12fa477a..c0c8a186 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -142,12 +142,18 @@ async fn is_debug_mode() -> bool {
#[tauri::command]
/// Returns true if linux compatible
async fn linux_checks() -> Result<(), String> {
- // Early return if Windows
- if get_host_os() == "windows" {
- return Err("Not available on Windows".to_string());
+ // Different behaviour depending on OS
+ // MacOS is missing as it is not a target
+ // in turn this means this application will not build on MacOS.
+ #[cfg(target_os = "windows")]
+ {
+ Err("Not available on Windows".to_string())
}
- linux_checks_librs()
+ #[cfg(target_os = "linux")]
+ {
+ linux_checks_librs()
+ }
}
#[tauri::command]