-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
35 lines (26 loc) · 1.05 KB
/
build.rs
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
use std::env;
use std::path::Path;
use std::process::Command;
// Bring in a dependency on an externally maintained `gcc` package which manages
// invoking the C compiler.
extern crate gcc;
fn main() {
gcc::compile_library("libtweetnacl.a", &["lib/tweetnacl/tweetnacl.c"]);
/*
let out_dir = env::var("OUT_DIR").unwrap();
Command::new("gcc")
.args(&["lib/tweetnacl/tweetnacl.c", "-c", "-fPIC", "-Wall", "-std=c99", "-Ilib/tweetnacl/", "-o"])
.arg(&format!("{}/tweetnacl.o", out_dir))
.status().unwrap();
Command::new("ar")
.args(&["rcs", "libtweetnacl.a", "tweetnacl.o"])
.current_dir(&Path::new(&out_dir))
.status().unwrap();
println!("cargo:rustc-link-search=native={}", out_dir);
//println!("cargo:rustc-link-lib=static=tweetnacl");
*/
//println!("cargo:rustc-link-lib=tweetnacl");
//println!("cargo:rustc-link-search=lib/tweetnacl/");
//println!("cargo:include=lib/tweetnacl/tweetnacl.h");
//println!("cargo:include=lib/tweetnacl/");
}