We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f1e072 commit 2289ceeCopy full SHA for 2289cee
cpp_build/src/lib.rs
@@ -56,6 +56,13 @@ The OUT_DIR environment variable was not set.
56
NOTE: rust-cpp's build function must be run in a build script."#));
57
58
static ref CPP_DIR: PathBuf = OUT_DIR.join("rust_cpp");
59
+
60
+ static ref CARGO_MANIFEST_DIR: PathBuf =
61
+ PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect(r#"
62
+-- rust-cpp fatal error --
63
64
+The CARGO_MANIFEST_DIR environment variable was not set.
65
+NOTE: rust-cpp's build function must be run in a build script."#));
66
}
67
68
fn gen_cpp_lib(visitor: &Handle) -> PathBuf {
@@ -248,6 +255,7 @@ impl Config {
248
255
pub fn new() -> Config {
249
256
let mut gcc = gcc::Build::new();
250
257
gcc.cpp(true);
258
+ gcc.include(&*CARGO_MANIFEST_DIR);
251
259
Config { gcc: gcc }
252
260
253
261
0 commit comments