-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.rs
29 lines (24 loc) · 874 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use cfg_aliases::cfg_aliases;
use std::env;
const EXECUTOR_FEATURES: &[&str] = &[
"CARGO_FEATURE_RUNTIME_BASTION",
"CARGO_FEATURE_RUNTIME_TOKIO",
"CARGO_FEATURE_RUNTIME_TOKIO1",
"CARGO_FEATURE_RUNTIME_ASYNCSTD",
"CARGO_FEATURE_RUNTIME_SMOL",
];
fn main() {
println!("cargo:rerun-if-changed=build.rs");
if EXECUTOR_FEATURES.iter().filter_map(env::var_os).count() > 1 {
panic!("you can only enable one runtime feature flag for agnostik");
}
cfg_aliases! {
bastion: { feature = "runtime_bastion" },
tokio: { feature = "runtime_tokio" },
tokio1: { feature = "runtime_tokio1" },
async_std: { feature = "runtime_asyncstd" },
smol: { feature = "runtime_smol" },
local_spawn: { any(tokio, tokio1, async_std) },
enable: { any(smol, tokio, tokio1, async_std, bastion) },
}
}