1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Platform `cfg` aliases for frus.
//!
//! `frus-shell` is the only platform-dependent layer, and until now "desktop" was
//! written here **by negation**: `not(any(target_os = "android", target_arch =
//! "wasm32"))`. That spelling has a fatal flaw the moment a fourth platform
//! arrives: **iOS falls into it silently**, inheriting the `arboard` clipboard,
//! `env_logger` and AccessKit — three things with no UIKit backend. The code might
//! even compile, and it would be wrong.
//!
//! So we name the platforms explicitly, once. Adding a target now touches only
//! this file.
//!
//! Two limits worth knowing:
//!
//! 1. These aliases are `--cfg` flags passed to **this crate only**. They are not
//! visible in the application's crate — which is why the body of the
//! `frus_shell::main!` macro (which expands at the user's side) keeps explicit
//! `target_os` / `target_arch` predicates.
//! 2. Cargo does not evaluate these aliases in `[target.'cfg(…)'.dependencies]`
//! tables in `Cargo.toml`: dependency selection there stays written in
//! `target_os` / `target_arch`.