fn main() {
    // To reduce code duplication, have an internal feature "perf-event" that is
    // only set if both the OS is Linux and the cpu-instructions feature is
    // enabled.
    println!("cargo::rustc-check-cfg=cfg(feature, values(\"perf-event\"))");
    if std::env::var("CARGO_CFG_TARGET_OS") == Ok("linux".to_string())
        && std::env::var("CARGO_FEATURE_CPU_INSTRUCTIONS").is_ok()
    {
        println!("cargo::rustc-cfg=feature=\"perf-event\"");
    }
}
