mirror of
https://github.com/bdwgc/bdwgc-rust.git
synced 2026-05-29 09:58:55 -06:00
Build custom libgc
This commit is contained in:
37
build.rs
Normal file
37
build.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
extern crate cmake;
|
||||
|
||||
const LIB_ATOMIC_OPS_DIR: &str = "vendor/libatomic_ops";
|
||||
const LIB_GC_DIR: &str = "vendor/bdwgc";
|
||||
|
||||
fn main() {
|
||||
for dir in &[LIB_ATOMIC_OPS_DIR, LIB_GC_DIR] {
|
||||
std::process::Command::new("sh")
|
||||
.arg("-c")
|
||||
.arg(format!("cd {} && ./autogen.sh", dir))
|
||||
.output()
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
let dst = autotools::Config::new(LIB_ATOMIC_OPS_DIR)
|
||||
.cflag("-fPIC")
|
||||
.build();
|
||||
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
dst.join("lib").display()
|
||||
);
|
||||
println!("cargo:rustc-link-lib=static=atomic_ops");
|
||||
|
||||
let dst = autotools::Config::new(LIB_GC_DIR)
|
||||
.cflag(format!(
|
||||
"-I{} -L/lib/x86_64-linux-gnu -lpthread -fPIC",
|
||||
dst.join("include").display()
|
||||
))
|
||||
.build();
|
||||
|
||||
println!(
|
||||
"cargo:rustc-link-search=native={}",
|
||||
dst.join("lib").display()
|
||||
);
|
||||
println!("cargo:rustc-link-lib=static=gc");
|
||||
}
|
||||
Reference in New Issue
Block a user