-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
32 lines (26 loc) · 1 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
// Why this mess is necessary:
// Including rustychains_dylib in the workspace causes cargo
// to build it in a slightly different way than it would when build directly.
// This causes the interpose not to work as expect and all sorts of different trouble.
use std::{
io::{self, Write},
process::Command,
};
fn main() {
println!("cargo:rerun-if-changed=./build.rs");
// We don't want to include the 'target' folder.
println!("cargo:rerun-if-changed=./rustychains_dylib/src");
println!("cargo:rerun-if-changed=./rustychains_dylib/Cargo.toml");
let output = Command::new("cargo")
.arg("build")
.args(["--manifest-path", "./rustychains_dylib/Cargo.toml"])
.args(["--color", "always"])
.output()
.expect("Unable to build rustychains_dylib");
if output.status.success() {
return;
}
io::stdout().write_all(&output.stdout).unwrap();
io::stderr().write_all(&output.stderr).unwrap();
panic!("could not compile `rustychains_dylib`");
}