Skip to content

Make syntex optional with nightly rustc #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions libbindgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@ clap = "2"
shlex = "0.1"
tests_expectations = { path = "tests/expectations" }

[build-dependencies]
quasi_codegen = "0.21"
[build-dependencies.quasi_codegen]
default-features = false
version = "0.25"

[dependencies]
aster = "0.33"
cexpr = "0.2"
cfg-if = "0.1.0"
clang-sys = "0.8.0"
lazy_static = "0.1.*"
libc = "0.2"
rustc-serialize = "0.3.19"
syntex_syntax = "0.44"
quasi = "0.25"
regex = "0.1"
cexpr = "0.2"

[dependencies.aster]
features = ["with-syntex"]
version = "0.29"
rustc-serialize = "0.3.19"

[dependencies.clippy]
optional = true
Expand All @@ -49,14 +47,15 @@ version = "0.3"
optional = true
version = "0.3"

[dependencies.quasi]
features = ["with-syntex"]
version = "0.21"
[dependencies.syntex_syntax]
optional = true
version = "0.48"

[features]
default = ["logging"]
default = ["logging", "syntex"]
llvm_stable = []
logging = ["env_logger", "log"]
static = []
syntex = ["syntex_syntax", "aster/with-syntex", "quasi/with-syntex", "quasi_codegen/with-syntex"]
# This feature only exists for CI -- don't use it!
_docs = []
2 changes: 1 addition & 1 deletion libbindgen/src/ir/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ impl<'ctx> BindgenContext<'ctx> {
let sess = parse::ParseSess::new();
let mut loader = base::DummyResolver;
let mut ctx =
GenContext(base::ExtCtxt::new(&sess, vec![], cfg, &mut loader));
GenContext(base::ExtCtxt::new(&sess, cfg, &mut loader));

ctx.0.bt_push(ExpnInfo {
call_site: self.span,
Expand Down
9 changes: 8 additions & 1 deletion libbindgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#![cfg_attr(feature = "clippy", feature(plugin))]
#![cfg_attr(feature = "clippy", plugin(clippy))]

#![cfg_attr(not(feature = "syntex"), feature(rustc_private))]

#![deny(missing_docs)]
#![deny(warnings)]

Expand All @@ -22,7 +24,6 @@
#[macro_use]
extern crate cfg_if;
extern crate cexpr;
extern crate syntex_syntax as syntax;
extern crate aster;
extern crate quasi;
extern crate clang_sys;
Expand All @@ -39,6 +40,12 @@ extern crate log;
#[macro_use]
mod log_stubs;

#[cfg(feature = "syntex")]
extern crate syntex_syntax as syntax;

#[cfg(not(feature = "syntex"))]
extern crate syntax;

// A macro to declare an internal module for which we *must* provide
// documentation for. If we are building with the "_docs" feature, then the
// module is declared public, and our `#![deny(missing_docs)]` pragma applies to
Expand Down