Skip to content

Commit

Permalink
Further build fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Aug 19, 2024
1 parent cae1bdb commit d12036d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
5 changes: 5 additions & 0 deletions configure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 3 additions & 4 deletions testcrate/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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"),
Expand Down

0 comments on commit d12036d

Please sign in to comment.