feat(updater): add plugin (#350)

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
This commit is contained in:
Lucas Fernandes Nogueira
2023-05-11 13:33:24 -03:00
committed by GitHub
co-authored by Fabian-Lars
parent 012d32e8ed
commit a95fb473a2
38 changed files with 11939 additions and 517 deletions
+14
View File
@@ -0,0 +1,14 @@
fn main() {
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
let mobile = target_os == "ios" || target_os == "android";
alias("desktop", !mobile);
alias("mobile", mobile);
}
// creates a cfg alias if `has_feature` is true.
// `alias` must be a snake case string.
fn alias(alias: &str, has_feature: bool) {
if has_feature {
println!("cargo:rustc-cfg={alias}");
}
}