aboutsummaryrefslogtreecommitdiff
path: root/libgrust/rustc-lib/stdarch/crates/assert-instr-macro/build.rs
blob: 45a868441c4aec9df5e36056bba003b94180cc6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::env;

fn main() {
    println!("cargo:rerun-if-changed=build.rs");
    let opt_level = env::var("OPT_LEVEL")
        .ok()
        .and_then(|s| s.parse().ok())
        .unwrap_or(0);
    let profile = env::var("PROFILE").unwrap_or(String::new());
    if profile == "release" || opt_level >= 2 {
        println!("cargo:rustc-cfg=optimized");
    }
}