i wish rust had block conditional compilation

macos-click-through
exoticus 5 years ago
parent 9e6c41ac65
commit fb9c877afc

1
Cargo.lock generated

@ -1151,6 +1151,7 @@ version = "0.5.0"
dependencies = [
"anyhow",
"async-trait",
"cfg-if",
"derive-new",
"euclid",
"flexi_logger",

@ -31,6 +31,7 @@ log = "0.4.8"
flexi_logger = { version = "0.14.6", default-features = false }
anyhow = "1.0.26"
parking_lot="0.10.0"
cfg-if = "0.1.10"
[target.'cfg(windows)'.dependencies]
winapi = "0.3.8"

@ -16,35 +16,27 @@ use log::{info, trace, warn};
const STANDARD_CHARACTER_STRING: &str =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
#[cfg(target_os = "windows")]
cfg_if::cfg_if! {
if #[cfg(target_os = "windows")] {
const SYSTEM_DEFAULT_FONT: &str = "Consolas";
#[cfg(target_os = "linux")]
const SYSTEM_DEFAULT_FONT: &str = "Droid Sans Mono";
#[cfg(target_os = "macos")]
const SYSTEM_DEFAULT_FONT: &str = "Menlo";
#[cfg(target_os = "windows")]
const SYSTEM_SYMBOL_FONT: &str = "Segoe UI Symbol";
const SYSTEM_EMOJI_FONT: &str = "Segoe UI Emoji";
#[cfg(target_os = "linux")]
} else if #[cfg(target_os = "linux")] {
const SYSTEM_DEFAULT_FONT: &str = "Droid Sans Mono";
const SYSTEM_SYMBOL_FONT: &str = "Unifont";
const SYSTEM_EMOJI_FONT: &str = "Noto Color Emoji";
#[cfg(target_os = "macos")]
const SYSTEM_SYMBOL_FONT: &str = "Apple Symbols";
#[cfg(target_os = "windows")]
const SYSTEM_EMOJI_FONT: &str = "Segoe UI Emoji";
#[cfg(target_os = "macos")]
} else if #[cfg(target_os = "macos")] {
const SYSTEM_DEFAULT_FONT: &str = "Menlo";
const SYSTEM_SYMBOL_FONT: &str = "Apple Symbols";
const SYSTEM_EMOJI_FONT: &str = "Apple Color Emoji";
}
}
#[cfg(target_os = "linux")]
const SYSTEM_EMOJI_FONT: &str = "Noto Color Emoji";
const SYMBOL_FONT: &str = "Extra Symbols.otf";
const MISSING_GLYPHS_FONT: &str = "Missing Glyphs.otf";
const EXTRA_SYMBOL_FONT: &str = "Extra Symbols.otf";
const MISSING_GLYPH_FONT: &str = "Missing Glyphs.otf";
#[cfg(feature = "embed-fonts")]
#[derive(RustEmbed)]

Loading…
Cancel
Save