enable both FASTWAVE_PLATFORM values in Rust Analyzer

This commit is contained in:
Martin Kavík 2024-06-01 23:46:12 +02:00
parent be5d33e5c1
commit 84700cf61b
4 changed files with 8 additions and 1 deletions

View file

@ -16,7 +16,8 @@ macro_rules! instruction {
// }
fn main() {
let default_platform = "BROWSER";
let default_platform = "TAURI";
let platform = env::var("FASTWAVE_PLATFORM").unwrap_or_else(|_| default_platform.to_owned());
instruction!("cargo:rustc-cfg=FASTWAVE_PLATFORM=\"{platform}\"");
instruction!("cargo:rerun-if-env-changed=FASTWAVE_PLATFORM");
}

View file

@ -1,6 +1,8 @@
// @TODO maybe rewrite `FASTWAVE_PLATFORM` to features once it's possible to set them through env vars:
// https://github.com/rust-lang/cargo/issues/4829
// NOTE: `FASTWAVE_PLATFORM` is set in `Makefile.toml` tasks and then in `build.rs`
#[cfg(FASTWAVE_PLATFORM = "TAURI")]
mod tauri;
#[cfg(FASTWAVE_PLATFORM = "TAURI")]