diff --git a/Cargo.toml b/Cargo.toml index e3ae0e8c16b2b..9c19649c851cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ A library for types and bindings to native C functions often found in libc or other common platform libraries. """ include = ["Cargo.toml", "rust/src/liblibc/*"] +build = "build.rs" [features] default = ["cargo-build"] @@ -21,3 +22,5 @@ cargo-build = [] [lib] name = "libc" path = "rust/src/liblibc/lib.rs" + + diff --git a/build.rs b/build.rs new file mode 100644 index 0000000000000..30eae27437528 --- /dev/null +++ b/build.rs @@ -0,0 +1,7 @@ +use std::env; + +fn main() { + if let Ok(path) = env::var("LIBC_PATH") { + println!("cargo:rustc-link-search={}", path); + } +}