diff options
| author | 2025-01-22 02:08:31 -0600 | |
|---|---|---|
| committer | 2025-01-22 02:10:20 -0600 | |
| commit | e88c17a44c94f788e945c5728bc18beca7e0f8a6 (patch) | |
| tree | 586873a545cb6bc799129219d5e809106daa58c1 /src/launcher/jre/arch.rs | |
| parent | support jre specified in profile (diff) | |
get started on downloading JREs
also refactor ensure file logic
Diffstat (limited to 'src/launcher/jre/arch.rs')
| -rw-r--r-- | src/launcher/jre/arch.rs | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/launcher/jre/arch.rs b/src/launcher/jre/arch.rs new file mode 100644 index 0000000..e984171 --- /dev/null +++ b/src/launcher/jre/arch.rs @@ -0,0 +1,45 @@ +use cfg_if::cfg_if; + +macro_rules! define_arch { + ($arch:expr) => { + pub const JRE_ARCH: &str = $arch; + } +} + +cfg_if! { + if #[cfg(target_os = "windows")] { + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + define_arch!("windows-x64"); + } else if #[cfg(target_arch = "x86")] { + define_arch!("windows-x86"); + } else if #[cfg(target_arch = "aarch64")] { + define_arch!("windows-arm64"); + } else { + define_arch!("gamecore"); + } + } + } else if #[cfg(target_os = "linux")] { + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + define_arch!("linux"); + } else if #[cfg(target_arch = "x86")] { + define_arch!("linux-i386"); + } else { + define_arch!("gamecore"); + } + } + } else if #[cfg(target_os = "macos")] { + cfg_if! { + if #[cfg(target_arch = "aarch64")] { + define_arch!("mac-os-arm64"); + } else if #[cfg(target_arch = "x86_64")] { + define_arch!("mac-os"); + } else { + define_arch!("gamecore"); + } + } + } else { + define_arch!("gamecore"); + } +} |
