File: build.rs

package info (click to toggle)
clamav 1.0.9%2Bdfsg-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 262,900 kB
  • sloc: ansic: 182,912; cpp: 6,947; python: 4,133; sh: 2,679; javascript: 2,195; yacc: 1,357; asm: 1,245; lex: 716; makefile: 108; perl: 17
file content (36 lines) | stat: -rw-r--r-- 1,358 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
extern crate version_check;

// All platforms except AArch64 with neon support enabled.
static MIN_RUSTC: &str = "1.37.0";
// On AArch64 with neon support enabled.
#[cfg(all(target_arch = "aarch64", feature = "neon"))]
static MIN_RUSTC_NEON: &str = "1.61.0";

#[cfg(not(all(target_arch = "aarch64", feature = "neon")))]
fn main() {
    println!("cargo:rerun-if-changed=build.rs");
    match version_check::is_min_version(MIN_RUSTC) {
        Some(true) => {}
        Some(false) => panic!(
            "\n====\nUnsupported rustc version {}\nRustFFT needs at least {}\n====\n",
            version_check::Version::read().unwrap(),
            MIN_RUSTC
        ),
        None => panic!("Unable to determine rustc version."),
    };
}

#[cfg(all(target_arch = "aarch64", feature = "neon"))]
fn main() {
    println!("cargo:rerun-if-changed=build.rs");
    match version_check::is_min_version(MIN_RUSTC_NEON) {
        Some(true) => {}
        Some(false) => panic!(
            "\n====\nUnsupported rustc version {}\nRustFFT with neon support needs at least {}\nIf the 'neon' feature flag is disabled, the minimum version is {}\n====\n",
            version_check::Version::read().unwrap(),
            MIN_RUSTC_NEON,
            MIN_RUSTC
        ),
        None => panic!("Unable to determine rustc version."),
    };
}