diff --git a/build.rs b/build.rs index 45f271e0..fcbf23db 100644 --- a/build.rs +++ b/build.rs @@ -5,7 +5,9 @@ mod configure; use configure::{configure_f16_f128, Target}; fn main() { - println!("cargo:rerun-if-changed=build.rs"); + println!("cargo::rerun-if-changed=build.rs"); + println!("cargo::rerun-if-changed=configure.rs"); + let target = Target::from_env(); let cwd = env::current_dir().unwrap(); diff --git a/configure.rs b/configure.rs index d17edc68..e23c0e83 100644 --- a/configure.rs +++ b/configure.rs @@ -41,6 +41,11 @@ impl Target { .collect(), } } + + #[allow(dead_code)] + pub fn has_feature(&self, feature: &str) -> bool { + self.features.iter().any(|f| f == feature) + } } /// Configure whether or not `f16` and `f128` support should be enabled. diff --git a/testcrate/build.rs b/testcrate/build.rs index b1ca2ca2..6205c7ac 100644 --- a/testcrate/build.rs +++ b/testcrate/build.rs @@ -14,9 +14,10 @@ mod builtins_configure { } fn main() { + println!("cargo::rerun-if-changed=../configure.rs"); + let target = builtins_configure::Target::from_env(); let mut features = HashSet::new(); - println!("cargo:warning=target: {target:?}"); // These platforms do not have f128 symbols available in their system libraries, so // skip related tests. @@ -56,7 +57,7 @@ fn main() { || target.arch == "powerpc" || target.arch == "powerpc64" || target.arch == "powerpc64le" - || target.arch == "i586" + || (target.arch == "x86" && !target.has_feature("sse")) || target.os == "windows" // Linking says "error: function signature mismatch: __extendhfsf2" and seems to // think the signature is either `(i32) -> f32` or `(f32) -> f32`. See @@ -68,8 +69,6 @@ fn main() { features.insert(Feature::NoSysF16F128Convert); } - println!("cargo:warning=features: {features:?}"); - for feature in features { let (name, warning) = match feature { Feature::NoSysF128 => ("no-sys-f128", "using apfloat fallback for f128"),