Skip to content

Commit

Permalink
Do not default to native target when $OPENBLAS_TARGET is invalid #78
Browse files Browse the repository at this point in the history
  • Loading branch information
termoshtt committed Sep 19, 2021
1 parent cee2fd0 commit e25b20f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions openblas-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,15 @@ fn build() {
} else {
cfg.no_static = true;
}
cfg.target = match env::var("OPENBLAS_TARGET") {
Ok(target) => target.parse().ok(),
_ => None,
};
if let Ok(target) = env::var("OPENBLAS_TARGET") {
cfg.target = Some(
target
.parse()
.expect("Unsupported target is specified by $OPENBLAS_TARGET"),
)
// Do not default to the native target (represented by `cfg.target == None`)
// because most user set `$OPENBLAS_TARGET` explicitly will hope not to use the native target.
}

let output = if feature_enabled("cache") {
use std::{collections::hash_map::DefaultHasher, hash::*};
Expand Down

0 comments on commit e25b20f

Please sign in to comment.