diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-12-12 23:42:00 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-12 23:42:00 -0800 |
commit | a0ace87c8a36ce0fdc11fe71b610689e9cf88bf0 (patch) | |
tree | d8c3b1f1828f19a2b1d44cf878aa20ac51acd4ad | |
parent | 5d9c48e59b49135db1ecfd4ff8c3dbab8ed05086 (diff) | |
parent | 3f711d85e72a4e4a516a8b128a9b212d8305b035 (diff) |
Auto merge of #331 - upsuper:patch-2, r=emilio
Fix issues in README
Mainly for fixing `env!("OUT_DIR")` usage in `build.rs`.
-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")); } ``` |