summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml3
-rw-r--r--build.rs2
2 files changed, 4 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index a85fa8a9..435bac8c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,6 +7,9 @@ license = "BSD-3-Clause"
build = "build.rs"
+[features]
+static = []
+
[lib]
name = "bindgen"
diff --git a/build.rs b/build.rs
index 0acde343..1b9b2828 100644
--- a/build.rs
+++ b/build.rs
@@ -7,7 +7,7 @@ const LINUX_CLANG_DIRS: &'static [&'static str] = &["/usr/lib", "/usr/lib/llvm",
const MAC_CLANG_DIR: &'static str = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib";
fn main() {
- let use_static_lib = env::var_os("LIBCLANG_STATIC").is_some();
+ let use_static_lib = env::var_os("LIBCLANG_STATIC").is_some() || cfg!(feature = "static");
let possible_clang_dirs = if let Ok(dir) = env::var("LIBCLANG_PATH") {
vec![dir]