Skip to content

Use target-specific dependencies #23

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

Merged
merged 1 commit into from
Jan 6, 2017
Merged
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
12 changes: 8 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ build = "build.rs"

[dependencies]
libc = "0.2"
backtrace-sys = { path = "backtrace-sys", version = "0.1.3", optional = true }
kernel32-sys = { version = "0.2", optional = true }
winapi = { version = "0.2.5", optional = true }
dbghelp-sys = { version = "0.2", optional = true }
cfg-if = "0.1"
rustc-demangle = "0.1"

# Optionally enable the ability to serialize a `Backtrace`
serde = { version = "0.8", optional = true }
rustc-serialize = { version = "0.3", optional = true }

[target.'cfg(windows)'.dependencies]
dbghelp-sys = { version = "0.2", optional = true }
kernel32-sys = { version = "0.2", optional = true }
winapi = { version = "0.2.5", optional = true }

[target.'cfg(all(unix, not(target_os = "emscripten"), not(target_os = "macos")))'.dependencies]
backtrace-sys = { path = "backtrace-sys", version = "0.1.3", optional = true }

[build-dependencies]
serde_codegen = { version = "0.8", optional = true }

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
#![deny(warnings)]

extern crate libc;
#[cfg(feature = "kernel32-sys")] extern crate kernel32;
#[cfg(feature = "winapi")] extern crate winapi;
#[cfg(feature = "dbghelp")] extern crate dbghelp;
#[cfg(all(windows, feature = "kernel32-sys"))] extern crate kernel32;
#[cfg(all(windows, feature = "winapi"))] extern crate winapi;
#[cfg(all(windows, feature = "dbghelp"))] extern crate dbghelp;

#[cfg(feature = "serde")]
extern crate serde;
Expand Down