File: build.rs

package info (click to toggle)
rust-sha2-asm 0.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 152 kB
  • sloc: asm: 733; makefile: 12
file content (24 lines) | stat: -rw-r--r-- 758 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
extern crate cc;

use std::env;

fn main() {
    let (sha256_path, sha512_path) = if cfg!(target_arch = "x86") {
        ("src/sha256_x86.S", "src/sha512_x86.S")
    } else if cfg!(target_arch = "x86_64") {
        ("src/sha256_x64.S", "src/sha512_x64.S")
    } else {
        panic!("Unsupported target architecture");
    };
    cc::Build::new()
              .flag("-c")
              .file(sha256_path)
              .compile("libsha256.a");
    cc::Build::new()
              .flag("-c")
              .file(sha512_path)
              .compile("libsha512.a");

    println!("dh-cargo:deb-built-using=sha256=0={}", env::var("CARGO_MANIFEST_DIR").unwrap());
    println!("dh-cargo:deb-built-using=sha512=0={}", env::var("CARGO_MANIFEST_DIR").unwrap());
}