Skip to content

Commit 2a52a24

Browse files
elmarcosdroege
authored andcommitted
Add a build.rs to link bindings against the impl version
1 parent db5e588 commit 2a52a24

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

build.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use std::env;
2+
3+
fn main() {
4+
if cfg!(feature = "bindings") {
5+
// assuming target dir isn't tweaked
6+
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
7+
let profile = env::var("PROFILE").unwrap();
8+
println!(
9+
"cargo:rustc-link-search=native={}/target/{}",
10+
manifest_dir, profile
11+
);
12+
println!("cargo:rustc-link-lib=dylib=gobject_example");
13+
}
14+
}

0 commit comments

Comments
 (0)