Skip to content

Commit 63af797

Browse files
committed
Find libunwind include path using pkg-config, fixes rust-lang#102
1 parent 16780ab commit 63af797

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

backtrace-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ libc = "0.2"
1616

1717
[build-dependencies]
1818
cc = "1.0"
19+
pkg-config = "0.3"

backtrace-sys/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
extern crate pkg_config;
12
extern crate cc;
23

34
use std::env;
@@ -48,6 +49,12 @@ fn main() {
4849
}
4950
}
5051

52+
if let Ok(unwind) = pkg_config::Config::new().probe("libunwind") {
53+
for path in unwind.include_paths {
54+
build.include(path);
55+
}
56+
}
57+
5158
File::create(out_dir.join("backtrace-supported.h")).unwrap();
5259
build.define("BACKTRACE_SUPPORTED", "1");
5360
build.define("BACKTRACE_USES_MALLOC", "1");

0 commit comments

Comments
 (0)