Skip to content

Commit 8246993

Browse files
committed
libbindgen: Make syntex optional
1 parent c800ad4 commit 8246993

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

libbindgen/Cargo.toml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,18 @@ shlex = "0.1"
2121
tests_expectations = { path = "tests/expectations" }
2222

2323
[build-dependencies]
24-
quasi_codegen = "0.20"
24+
quasi_codegen = "0.25"
2525

2626
[dependencies]
27+
aster = "0.33"
28+
cexpr = "0.2"
2729
cfg-if = "0.1.0"
2830
clang-sys = "0.8.0"
2931
lazy_static = "0.1.*"
3032
libc = "0.2"
3133
rustc-serialize = "0.3.19"
32-
syntex_syntax = "0.44"
3334
regex = "0.1"
34-
cexpr = "0.2"
35-
36-
[dependencies.aster]
37-
features = ["with-syntex"]
38-
version = "0.28"
35+
quasi = "0.25"
3936

4037
[dependencies.clippy]
4138
optional = true
@@ -49,14 +46,15 @@ version = "0.3"
4946
optional = true
5047
version = "0.3"
5148

52-
[dependencies.quasi]
53-
features = ["with-syntex"]
54-
version = "0.20"
49+
[dependencies.syntex_syntax]
50+
optional = true
51+
version = "0.48"
5552

5653
[features]
57-
default = ["logging"]
54+
default = ["logging", "syntex"]
5855
llvm_stable = []
5956
logging = ["env_logger", "log"]
6057
static = []
58+
syntex = ["syntex_syntax", "aster/with-syntex", "quasi/with-syntex"]
6159
# This feature only exists for CI -- don't use it!
6260
_docs = []

libbindgen/src/ir/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ impl<'ctx> BindgenContext<'ctx> {
397397
let sess = parse::ParseSess::new();
398398
let mut loader = base::DummyResolver;
399399
let mut ctx =
400-
GenContext(base::ExtCtxt::new(&sess, vec![], cfg, &mut loader));
400+
GenContext(base::ExtCtxt::new(&sess, cfg, &mut loader));
401401

402402
ctx.0.bt_push(ExpnInfo {
403403
call_site: self.span,

libbindgen/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#![cfg_attr(feature = "clippy", feature(plugin))]
99
#![cfg_attr(feature = "clippy", plugin(clippy))]
1010

11+
#![cfg_attr(not(feature = "syntex"), feature(rustc_private))]
12+
1113
#![deny(missing_docs)]
1214
#![deny(warnings)]
1315

@@ -22,7 +24,6 @@
2224
#[macro_use]
2325
extern crate cfg_if;
2426
extern crate cexpr;
25-
extern crate syntex_syntax as syntax;
2627
extern crate aster;
2728
extern crate quasi;
2829
extern crate clang_sys;
@@ -39,6 +40,12 @@ extern crate log;
3940
#[macro_use]
4041
mod log_stubs;
4142

43+
#[cfg(feature = "syntex")]
44+
extern crate syntex_syntax as syntax;
45+
46+
#[cfg(not(feature = "syntex"))]
47+
extern crate syntax;
48+
4249
// A macro to declare an internal module for which we *must* provide
4350
// documentation for. If we are building with the "_docs" feature, then the
4451
// module is declared public, and our `#![deny(missing_docs)]` pragma applies to

0 commit comments

Comments
 (0)