diff options
author | Xidorn Quan <github@upsuper.org> | 2016-12-12 13:48:58 -1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-12 13:48:58 -1000 |
commit | 3f711d85e72a4e4a516a8b128a9b212d8305b035 (patch) | |
tree | d8c3b1f1828f19a2b1d44cf878aa20ac51acd4ad /README.md | |
parent | 5d9c48e59b49135db1ecfd4ff8c3dbab8ed05086 (diff) |
Fix issues in README
Mainly for fixing `env!("OUT_DIR")` usage in `build.rs`.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -82,7 +82,7 @@ In `Cargo.toml`: ```toml [package] -... +# ... build = "build.rs" [build-dependencies.libbindgen] @@ -95,12 +95,16 @@ In `build.rs`: ```rust extern crate libbindgen; +use std::env; +use std::path::Path; + fn main() { + let out_dir = env::var("OUT_DIR").unwrap(); let _ = libbindgen::builder() .header("example.h") .use_core() .generate().unwrap() - .write_to_file(concat!(env!("OUT_DIR"), "/example.rs")); + .write_to_file(Path::new(&out_dir).join("example.rs")); } ``` |