Skip to content

Commit fdfd37e

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

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

intel-mkl-tool/src/entry.rs

+18-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,21 @@ impl Library {
6566
),
6667
_ => continue,
6768
};
68-
let dir = path.parent().unwrap().to_owned();
69+
let dir = path
70+
.parent()
71+
.expect("parent must exist here since this is under `root_dir`")
72+
.to_owned();
73+
// Skip directory for ia32
74+
for c in dir.components() {
75+
if let std::path::Component::Normal(c) = c {
76+
if c.to_str()
77+
.expect("Non-UTF8 directory name")
78+
.starts_with("ia32")
79+
{
80+
continue;
81+
}
82+
}
83+
}
6984
if stem == "mkl" && ext == "h" {
7085
include_dir = Some(dir);
7186
continue;

0 commit comments

Comments
 (0)