Skip to content

Commit 12f9852

Browse files
author
bors-servo
authored
Auto merge of #690 - KyleMayes:clang-sys, r=fitzgen
Bump clang-sys to 0.17.0 It turns out that some versions of Clang don't have `#include <...> search starts here:` in their output (KyleMayes/clang-sys#54). I changed the storage type of the include search paths in `clang-sys` from `Vec<PathBuf>` to `Option<Vec<PathBuf>>` to reflect the possibility that finding and parsing the include search paths might fail.
2 parents 3eb8f70 + a33fb57 commit 12f9852

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ quasi_codegen = "0.32"
4444
[dependencies]
4545
cexpr = "0.2"
4646
cfg-if = "0.1.0"
47-
clang-sys = { version = "0.16.0", features = ["runtime", "clang_3_9"] }
47+
clang-sys = { version = "0.17.0", features = ["runtime", "clang_3_9"] }
4848
lazy_static = "0.2.1"
4949
syntex_syntax = "0.58"
5050
regex = "0.2"

src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,12 @@ impl<'ctx> Bindings<'ctx> {
10471047
if !has_target_arg {
10481048
// TODO: distinguish C and C++ paths? C++'s should be enough, I
10491049
// guess.
1050-
for path in clang.cpp_search_paths.into_iter() {
1051-
if let Ok(path) = path.into_os_string().into_string() {
1052-
options.clang_args.push("-isystem".to_owned());
1053-
options.clang_args.push(path);
1050+
if let Some(cpp_search_paths) = clang.cpp_search_paths {
1051+
for path in cpp_search_paths.into_iter() {
1052+
if let Ok(path) = path.into_os_string().into_string() {
1053+
options.clang_args.push("-isystem".to_owned());
1054+
options.clang_args.push(path);
1055+
}
10541056
}
10551057
}
10561058
}

0 commit comments

Comments
 (0)