-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.rs
36 lines (33 loc) · 889 Bytes
/
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
35
36
use gpr::Project;
use std::{
path::Path,
process::{Command, Stdio},
};
fn main() {
let ada_hello = Project::load(Path::new("ada_hello/ada_hello.gpr")).unwrap();
let output = Command::new("gprbuild")
.args(ada_hello.gprbuild_args().unwrap())
.stderr(Stdio::inherit())
.output()
.unwrap();
if !output.status.success() {
panic!();
}
println!(
"cargo:rustc-link-search={}",
ada_hello.library_dir().unwrap().to_str().unwrap()
);
println!(
"cargo:rerun-if-changed={}",
ada_hello.source_dirs().unwrap()[0].as_str()
);
println!(
"cargo:rerun-if-changed={}",
ada_hello.library_dir().unwrap().to_str().unwrap()
);
println!(
"cargo:rustc-link-lib={}={}",
ada_hello.library_kind().unwrap(),
ada_hello.library_name().unwrap()
);
}