From 0b31d79bae147a4821b1a4328483d3d6c51cce27 Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Sun, 30 Jun 2024 14:19:00 -0300 Subject: [PATCH] fix default platform on geode build --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/project_build.rs | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fa8625b..e041b17 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -993,7 +993,7 @@ dependencies = [ [[package]] name = "geode" -version = "3.0.5" +version = "3.0.6" dependencies = [ "ansi_term", "cfg-if 1.0.0", diff --git a/Cargo.toml b/Cargo.toml index 666a017..0cc55d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "geode" -version = "3.0.5" +version = "3.0.6" authors = [ "HJfod ", "Camila314 ", diff --git a/src/project_build.rs b/src/project_build.rs index 0659cd7..087dd7c 100644 --- a/src/project_build.rs +++ b/src/project_build.rs @@ -22,7 +22,20 @@ pub fn build_project( s @ ("android32" | "android64") => String::from(s), s => fatal!("Unknown platform {s}"), }) - .unwrap_or_else(|| String::from("win")); + .unwrap_or_else(|| { + if cfg!(target_os = "windows") { + String::from("win") + } else if cfg!(target_os = "android") { + String::from("android64") + } else if cfg!(target_os = "linux") { + // maybe default to win whenever it can cross compile + String::from("android64") + } else if cfg!(target_os = "macos") { + String::from("mac") + } else { + fatal!("Unknown platform, please specify one with --platform"); + } + }); let cross_compiling = if cfg!(target_os = "windows") { platform != "win" } else if cfg!(target_os = "linux") {