Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion rust/lance-linalg/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,14 @@ fn main() -> Result<(), String> {
build_f16_with_flags("lsx", &["-mlsx"]).unwrap();
build_f16_with_flags("lasx", &["-mlasx"]).unwrap();
} else {
return Err("Unable to build f16 kernels on given target_arch. Please use x86_64 or aarch64 or remove the fp16kernels feature".to_string());
// Only error if fp16kernels was explicitly requested on unsupported platform.
// This allows builds on iOS, Android, etc. when the feature is disabled.
//
// Note: We use CARGO_FEATURE_* env var instead of cfg!() because cfg!()
// checks the build script's features, not the library's features.
if env::var("CARGO_FEATURE_FP16KERNELS").is_ok() {
return Err("Unable to build f16 kernels on given target_arch. Please use x86_64 or aarch64 or remove the fp16kernels feature".to_string());
}
}
Ok(())
}
Expand Down
Loading