Skip to content

Commit 7b31718

Browse files
author
Montana Low
committed
make cuda a feature
1 parent 303fe75 commit 7b31718

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@ derive_builder = "0.5"
1616
log = "0.4"
1717
tempfile = "3.0"
1818
indexmap = "1.0"
19-
20-
[features]
21-
cuda = []

xgboost-sys/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ libc = "0.2"
1515
[build-dependencies]
1616
bindgen = "0.61"
1717
cmake = "0.1"
18+
19+
[features]
20+
cuda = []

xgboost-sys/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ fn main() {
2222
}
2323

2424
// CMake
25+
#[cfg(feature = "cuda")]
2526
let dst = Config::new(&xgb_root)
2627
.uses_cxx11()
2728
.define("BUILD_STATIC_LIB", "ON")
@@ -30,6 +31,12 @@ fn main() {
3031
.define("BUILD_WITH_CUDA_CUB", "ON")
3132
.build();
3233

34+
#[cfg(not(feature = "cuda"))]
35+
let dst = Config::new(&xgb_root)
36+
.uses_cxx11()
37+
.define("BUILD_STATIC_LIB", "ON")
38+
.build();
39+
3340
let xgb_root = xgb_root.canonicalize().unwrap();
3441

3542
let bindings = bindgen::Builder::default()

0 commit comments

Comments
 (0)