Skip to content

Commit d54fe74

Browse files
author
Jorge Aparicio
committed
add a cargo feature to statically link to libclang
1 parent 5ae225e commit d54fe74

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ license = "BSD-3-Clause"
77

88
build = "build.rs"
99

10+
[features]
11+
static = []
12+
1013
[lib]
1114

1215
name = "bindgen"

build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const LINUX_CLANG_DIRS: &'static [&'static str] = &["/usr/lib", "/usr/lib/llvm",
77
const MAC_CLANG_DIR: &'static str = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib";
88

99
fn main() {
10-
let use_static_lib = env::var_os("LIBCLANG_STATIC").is_some();
10+
let use_static_lib = env::var_os("LIBCLANG_STATIC").is_some() || cfg!(feature = "static");
1111

1212
let possible_clang_dirs = if let Ok(dir) = env::var("LIBCLANG_PATH") {
1313
vec![dir]

0 commit comments

Comments
 (0)