Skip to content

Commit 4cfc291

Browse files
Conditional compilation within build script
1 parent 4efb21a commit 4cfc291

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/iconv-sys/build.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
extern crate bindgen;
22

3-
use std::env;
4-
use std::fs;
5-
use std::path::PathBuf;
6-
3+
#[cfg(windows)]
74
fn main() {
5+
use std::env;
6+
use std::fs;
7+
use std::path::PathBuf;
8+
89
let project_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
910

1011
let root = project_dir.join("vendor").join("libiconv-win-build");
@@ -74,3 +75,8 @@ fn main() {
7475
.write_to_file(out_path.join("bindings.rs"))
7576
.expect("Couldn't write bindings!");
7677
}
78+
79+
#[cfg(not(windows))]
80+
fn main() {
81+
()
82+
}

crates/readstat-tests/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ authors = ["Curtis Alexander <calex@calex.org>"]
55
edition = "2021"
66

77
[dependencies]
8+
arrow2 = { version = "0.14", features = ["full"] }
89
assert_cmd = "2.0"
910
assert_fs = "1.0"
11+
chrono = { version = "0.4", features = ["serde"] }
1012
path_abs = "0.5"
1113
polars = { version = "0.24", features = ["parquet"] }
1214
predicates = "2.1"
13-
arrow2 = { version = "0.14", features = ["full"] }
14-
chrono = { version = "0.4", features = ["serde"] }
1515
readstat = { path = "../readstat" }
1616

1717
[[test]]

0 commit comments

Comments
 (0)