Debian Codegraph @

third_party/rust/neqo-common/build.rs

raw
1 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
2 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
4 // option. This file may not be copied, modified, or distributed
5 // except according to those terms.
6
7 #![expect(clippy::unwrap_used, reason = "OK in a build script.")]
8
9 use std::env;
10
11 fn main() {
12 let target = env::var("TARGET").unwrap();
13 if target.contains("windows") {
14 println!("cargo:rustc-link-lib=winmm");
15 }
16
17 // `cfg(sanitize = "..")` is not stabilized.
18 //
19 // See <https://doc.rust-lang.org/stable/unstable-book/language-features/cfg-sanitize.html>.
20 println!("cargo:rustc-check-cfg=cfg(neqo_sanitize)");
21 if env::var("CARGO_CFG_SANITIZE").is_ok() {
22 println!("cargo:rustc-cfg=neqo_sanitize");
23 }
24 }