Skip to content

Commit 7222d9b

Browse files
committed
use platform-specific dependencies
1 parent f028bc4 commit 7222d9b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

rayon-demo/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ docopt = "1"
1111
fixedbitset = "0.1.5"
1212
glium = "0.21"
1313
lazy_static = "1"
14-
libc = "0.2"
1514
odds = "0.3"
1615
rand = "0.5"
1716
regex = "1"
1817
serde = "1"
1918
serde_derive = "1"
2019
time = "0.1"
20+
21+
[target.'cfg(unix)'.dependencies]
22+
libc = "0.2"
23+
24+
[target.'cfg(windows)'.dependencies]
2125
winapi = { version = "0.3", features = ["processthreadsapi"] }
2226

2327
[dev-dependencies]

rayon-demo/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ extern crate serde; // all
3333
extern crate cgmath; // nbody
3434
#[macro_use]
3535
extern crate glium; // nbody
36+
#[cfg(unix)]
3637
extern crate libc; // life
3738
extern crate rand; // nbody
3839
extern crate time; // nbody, sieve
@@ -43,6 +44,7 @@ extern crate num; // factorial
4344
extern crate lazy_static; // find
4445
extern crate fixedbitset; // tsp
4546
extern crate regex; // tsp
47+
#[cfg(windows)]
4648
extern crate winapi; // life
4749

4850
#[cfg(test)]

0 commit comments

Comments
 (0)