Skip to content

Commit 9c0ed5e

Browse files
committed
Do not seek ia32 directory
1 parent 8166537 commit 9c0ed5e

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

intel-mkl-tool/src/entry.rs

+22-3
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ impl Library {
4646

4747
/// Seek MKL libraries in the given directory.
4848
///
49-
/// This will seek the directory recursively until finding MKL libraries.
50-
/// This do not follow symbolic links.
49+
/// - This will seek the directory recursively until finding MKL libraries,
50+
/// but do not follow symbolic links.
51+
/// - This will not seek directory named `ia32*`
5152
///
5253
pub fn seek_directory(config: Config, root_dir: impl AsRef<Path>) -> Option<Self> {
5354
let mut library_dir = None;
@@ -65,7 +66,25 @@ impl Library {
6566
),
6667
_ => continue,
6768
};
68-
let dir = path.parent().unwrap().to_owned();
69+
// Skip directory for ia32
70+
if path.components().any(|c| {
71+
if let std::path::Component::Normal(c) = c {
72+
if c.to_str()
73+
.expect("Non-UTF8 directory name")
74+
.starts_with("ia32")
75+
{
76+
return true;
77+
}
78+
}
79+
false
80+
}) {
81+
continue;
82+
}
83+
84+
let dir = path
85+
.parent()
86+
.expect("parent must exist here since this is under `root_dir`")
87+
.to_owned();
6988
if stem == "mkl" && ext == "h" {
7089
include_dir = Some(dir);
7190
continue;

0 commit comments

Comments
 (0)