Skip to content

Commit 1c95788

Browse files
committed
chore: link libm on posix systems
1 parent 5a44c59 commit 1c95788

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bindings/c/build.rs

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ use std::path::PathBuf;
55
const DIR_FOR_HEADER: &str = "build";
66

77
fn main() {
8+
// linker flags
9+
// Link libm on Unix-like systems (needed due to use of num_cpus crate)
10+
#[cfg(not(target_os = "windows"))]
11+
println!("cargo:rustc-link-lib=m");
12+
813
println!("cargo:rerun-if-changed=src/");
914
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
1015
let package_name = env::var("CARGO_PKG_NAME").unwrap();

0 commit comments

Comments
 (0)