Debian Codegraph @

third_party/rust/error-chain/build.rs

raw
1 extern crate version_check;
2
3 use std::env;
4 use version_check::is_min_version;
5
6 fn main() {
7 // Switch on for versions that have Error::source
8 // As introduced by https://github.com/rust-lang/rust/pull/53533
9 if is_min_version("1.30").unwrap_or(false) {
10 println!("cargo:rustc-cfg=has_error_source");
11 }
12
13 if is_min_version("1.42").unwrap_or(false) {
14 println!("cargo:rustc-cfg=has_error_description_deprecated");
15 }
16
17 // So we can get the build profile for has_backtrace_depending_on_env test
18 if let Ok(profile) = env::var("PROFILE") {
19 println!("cargo:rustc-cfg=build={:?}", profile);
20 }
21 }