We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5d9c48e + 3f711d8 commit a0ace87Copy full SHA for a0ace87
README.md
@@ -82,7 +82,7 @@ In `Cargo.toml`:
82
83
```toml
84
[package]
85
-...
+# ...
86
build = "build.rs"
87
88
[build-dependencies.libbindgen]
@@ -95,12 +95,16 @@ In `build.rs`:
95
```rust
96
extern crate libbindgen;
97
98
+use std::env;
99
+use std::path::Path;
100
+
101
fn main() {
102
+ let out_dir = env::var("OUT_DIR").unwrap();
103
let _ = libbindgen::builder()
104
.header("example.h")
105
.use_core()
106
.generate().unwrap()
- .write_to_file(concat!(env!("OUT_DIR"), "/example.rs"));
107
+ .write_to_file(Path::new(&out_dir).join("example.rs"));
108
}
109
```
110
0 commit comments