cargo_mobile2/os/
mod.rs

1#![allow(unsafe_code)]
2
3#[cfg(target_os = "macos")]
4mod macos;
5
6#[cfg(target_os = "macos")]
7pub use self::macos::*;
8
9#[cfg(target_os = "linux")]
10mod linux;
11
12#[cfg(target_os = "linux")]
13pub use self::linux::*;
14
15#[cfg(windows)]
16mod windows;
17
18#[cfg(windows)]
19pub use self::windows::*;
20
21#[cfg(not(any(target_os = "macos", target_os = "linux", windows)))]
22compile_error!("Host platform not yet supported by cargo-mobile2! We'd love if you made a PR to add support for this platform ❤️");
23
24// TODO: we should probably expose common functionality throughout `os` in a
25// less ad-hoc way... since it's really easy to accidentally break things.
26#[derive(Debug)]
27pub struct Info {
28    pub name: String,
29    pub version: String,
30}
31
32impl Info {
33    pub fn check() -> Result<Self, impl std::error::Error> {
34        self::info::check()
35    }
36}