From f739f6929a17a2f0397228c8b0ac3ed1600d3918 Mon Sep 17 00:00:00 2001 From: Emilio Cobos Álvarez Date: Sat, 25 Jun 2016 14:46:21 +0200 Subject: Fix travis CI allowing to build on llvm stable --- .travis.yml | 3 +-- Cargo.toml | 1 + Makefile | 2 +- src/clang.rs | 9 +++++++++ src/clangll.rs | 1 + 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ae5d843..2b4fd5ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,8 +38,7 @@ before_script: - echo $LIBCLANG_PATH script: - - cargo build - - cargo build --verbose + - cargo build --verbose --features llvm_stable - make test - git add -A - git diff-index --quiet HEAD diff --git a/Cargo.toml b/Cargo.toml index c3f31686..0261c19d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,7 @@ syntex_syntax = "0.32" [features] static = [] +llvm_stable = [] [lib] name = "bindgen" diff --git a/Makefile b/Makefile index be0441c9..853eb195 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ BINDGEN := ./target/debug/bindgen .PHONY: $(BINDGEN) $(BINDGEN): - cargo build + [ -f $@ ] || cargo build .PHONY: test test: regen-tests diff --git a/src/clang.rs b/src/clang.rs index 9c46a94e..6233adea 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -135,10 +135,19 @@ impl Cursor { } } + #[cfg(not(feature="llvm_stable"))] pub fn is_inlined_function(&self) -> bool { unsafe { clang_Cursor_isFunctionInlined(self.x) != 0 } } + // TODO: Remove this when LLVM 3.9 is released. + // + // This is currently used for CI purposes. + #[cfg(feature="llvm_stable")] + pub fn is_inlined_function(&self) -> bool { + false + } + // bitfield pub fn bit_width(&self) -> Option { unsafe { diff --git a/src/clangll.rs b/src/clangll.rs index 4877ea70..dd836694 100644 --- a/src/clangll.rs +++ b/src/clangll.rs @@ -1109,6 +1109,7 @@ extern "C" { pub fn clang_Type_getTemplateArgumentAsType(T: CXType, i: c_int) -> CXType; pub fn clang_Cursor_isBitField(C: CXCursor) -> c_uint; + #[cfg(not(feature="llvm_stable"))] pub fn clang_Cursor_isFunctionInlined(C: CXCursor) -> c_uint; pub fn clang_isVirtualBase(arg1: CXCursor) -> c_uint; pub fn clang_getCXXAccessSpecifier(arg1: CXCursor) -> -- cgit v1.2.3