2024-06-01 21:29:56 +00:00
|
|
|
use std::env;
|
|
|
|
|
|
|
|
// https://doc.rust-lang.org/cargo/reference/build-scripts.html
|
|
|
|
|
|
|
|
macro_rules! instruction {
|
|
|
|
($($arg: tt)*) => {
|
|
|
|
println!($($arg)*)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// https://github.com/rust-lang/cargo/issues/985
|
|
|
|
// macro_rules! warning {
|
|
|
|
// ($($arg: tt)*) => {
|
|
|
|
// instruction!("cargo:warning={}", format!($($arg)*))
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
fn main() {
|
2024-06-01 21:46:12 +00:00
|
|
|
let default_platform = "TAURI";
|
2024-06-01 21:29:56 +00:00
|
|
|
let platform = env::var("FASTWAVE_PLATFORM").unwrap_or_else(|_| default_platform.to_owned());
|
|
|
|
instruction!("cargo:rustc-cfg=FASTWAVE_PLATFORM=\"{platform}\"");
|
2024-06-01 21:46:12 +00:00
|
|
|
instruction!("cargo:rerun-if-env-changed=FASTWAVE_PLATFORM");
|
2024-06-01 21:29:56 +00:00
|
|
|
}
|