extern arithmetic
This commit is contained in:
39
build.rs
39
build.rs
@@ -6,7 +6,7 @@ fn main() {
|
||||
builder.compiler("clang");
|
||||
}
|
||||
|
||||
builder.flag("-O3").flag("-flto=thin");
|
||||
builder.flag("-flto=thin");
|
||||
|
||||
build_ll(builder.clone());
|
||||
build_c(builder);
|
||||
@@ -21,13 +21,32 @@ fn build_ll(mut builder: cc::Build) {
|
||||
}
|
||||
|
||||
fn build_c(mut builder: cc::Build) {
|
||||
builder
|
||||
.file("src/math/math.c")
|
||||
.flag("-ffinite-math-only")
|
||||
.flag("-fassociative-math")
|
||||
.flag("-freciprocal-math")
|
||||
.flag("-fno-signed-zeros")
|
||||
.flag("-fno-trapping-math")
|
||||
.flag("-ffp-contract=fast")
|
||||
.compile("math")
|
||||
builder.flag("-O3");
|
||||
|
||||
#[cfg(feature = "finite-math-only")]
|
||||
builder.flag("-ffinite-math-only");
|
||||
|
||||
#[cfg(feature = "associative-math")]
|
||||
builder.flag("-fassociative-math");
|
||||
|
||||
#[cfg(feature = "reciprocal-math")]
|
||||
builder.flag("-freciprocal-math");
|
||||
|
||||
#[cfg(feature = "no-signed-zeros")]
|
||||
builder.flag("-fno-signed-zeros");
|
||||
|
||||
#[cfg(feature = "no-trapping-math")]
|
||||
builder.flag("-fno-trapping-math");
|
||||
|
||||
#[cfg(feature = "fp-contract-fast")]
|
||||
builder.flag("-ffp-contract=fast");
|
||||
|
||||
// TODO figure out if this works
|
||||
//#[cfg(feature = "approx-func")]
|
||||
//builder.flag("-Xclang -fapprox-func");
|
||||
|
||||
#[cfg(feature = "denormal-fp-math-preserve-sign")]
|
||||
builder.flag("-fdenormal-fp-math=preserve-sign");
|
||||
|
||||
builder.file("src/math/math.c").compile("math")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user