Skip to content

Commit 27b7aeb

Browse files
committed
Create default feature testcpp for C++ tests
1 parent df1c272 commit 27b7aeb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ license = "LGPL-3.0"
1111
[build-dependencies]
1212
bindgen = "0.58"
1313
cmake = "0.1"
14+
15+
[features]
16+
default = ["testcpp"]
17+
testcpp = []

build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ fn main() {
77
let mut cmake = cmake::Config::new("third-party/libswiftnav/");
88
let out_dir = env::var("OUT_DIR").unwrap();
99

10+
if !cfg!(feature = "testcpp") {
11+
cmake
12+
.define("libswiftnav_ENABLE_TESTS", "OFF")
13+
.define("libswiftnav_ENABLE_TEST_LIBS", "OFF");
14+
}
15+
1016
cmake
1117
.profile("Release")
1218
.define("CMAKE_INSTALL_PREFIX", out_dir);

0 commit comments

Comments
 (0)