runtime_cfg
Evaluation of configuration flags, at runtime-time.
To use runtime_cfg
in your project, add the following to your Cargo.toml:
toml
[dependencies]
runtime-cfg = "0.1"
```rust use std::convert::TryFrom;
use quote::quote;
use runtime_cfg::*;
let cfg = quote! { #[cfg(all(unix, targetpointerwidth = "32"))] };
let cfg = Cfg::tryfrom(cfg).unwrap(); asserteq!(cfg, all(vec![name("unix"), namevalue("targetpointer_width", "32")]).into());
let flags = vec![("unix", None), ("targetpointerwidth", Some("32"))]; assert!(cfg.matches(&flags));
```