diff options
| author | Jack O'Connor <[email protected]> | 2024-06-01 11:47:20 -0700 |
|---|---|---|
| committer | Jack O'Connor <[email protected]> | 2024-06-01 12:06:25 -0700 |
| commit | 454ee5a7c73583cb3060d1464a5d3a4e65f06062 (patch) | |
| tree | ff19c53d8c171569a62b3af258e5df64c10848e5 | |
| parent | b5c6017ea74d7a8be302aefd710dd801c91088a2 (diff) | |
add check-cfg directives in build.rs to silence nightly warnings
See https://blog.rust-lang.org/2024/05/06/check-cfg.html.
| -rw-r--r-- | build.rs | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -240,6 +240,23 @@ fn build_neon_c_intrinsics() { } fn main() -> Result<(), Box<dyn std::error::Error>> { + // As of Rust 1.80, unrecognized config names are warnings. Give Cargo all of our config names. + let all_cfgs = [ + "blake3_sse2_ffi", + "blake3_sse2_rust", + "blake3_sse41_ffi", + "blake3_sse41_rust", + "blake3_avx2_ffi", + "blake3_avx2_rust", + "blake3_avx512_ffi", + "blake3_neon", + ]; + for cfg_name in all_cfgs { + // TODO: Switch this whole file to the new :: syntax when our MSRV reaches 1.77. + // https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script + println!("cargo:rustc-check-cfg=cfg({cfg_name}, values(none()))"); + } + if is_pure() && is_neon() { panic!("It doesn't make sense to enable both \"pure\" and \"neon\"."); } |
