From 12739ba218afe911f90a24b373a3c851c53392b5 Mon Sep 17 00:00:00 2001 From: dvkt Date: Sat, 4 Jan 2020 14:10:51 -0800 Subject: [PATCH] store host triple during build --- build.rs | 6 ++++++ src/lib.rs | 1 + 2 files changed, 7 insertions(+) create mode 100644 build.rs diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..58a6a7e --- /dev/null +++ b/build.rs @@ -0,0 +1,6 @@ +fn main() { + println!( + "cargo:rustc-env=PLATFORM={}", + std::env::var("TARGET").unwrap() + ); +} diff --git a/src/lib.rs b/src/lib.rs index 3f246f4..d1ff943 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,4 +12,5 @@ pub mod text; pub mod ui; pub const VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const PLATFORM: &str = env!("PLATFORM"); pub const BUG_URL: &str = "https://github.com/dvkt/phetch/issues/new";