Skip to content

Commit 292ad1f

Browse files
committed
Move _dll suffix
1 parent fee681c commit 292ad1f

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

intel-mkl-tool/src/entry.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ pub fn mkl_libs(cfg: Config) -> Vec<String> {
2828
}
2929
};
3030
libs.push("mkl_core".into());
31-
libs
31+
32+
if cfg!(target_os = "windows") && cfg.link == LinkType::Dynamic {
33+
libs.into_iter().map(|lib| format!("{}_dll", lib)).collect()
34+
} else {
35+
libs
36+
}
3237
}
3338

3439
/// MKL Libraries to be loaded dynamically
@@ -45,22 +50,26 @@ pub fn mkl_dyn_libs(cfg: Config) -> Vec<String> {
4550
libs.push("mkl_rt".into());
4651
libs.push("mkl_vml_mc2".into());
4752
libs.push("mkl_vml_cmpt".into());
48-
libs
53+
54+
if cfg!(target_os = "windows") {
55+
libs.into_iter().map(|lib| format!("{}_dll", lib)).collect()
56+
} else {
57+
libs
58+
}
4959
}
5060
}
5161
}
5262

5363
/// Filename convention for MKL libraries.
5464
pub fn mkl_file_name(link: LinkType, name: &str) -> String {
5565
if cfg!(target_os = "windows") {
56-
match link {
57-
LinkType::Static => {
58-
format!("{}.lib", name)
59-
}
60-
LinkType::Dynamic => {
61-
format!("{}_dll.lib", name)
62-
}
63-
}
66+
// On windows
67+
//
68+
// - Static: mkl_core.lib
69+
// - Dynamic: mkl_core_dll.lib
70+
//
71+
// and `_dll` suffix is added in [mkl_libs] and [mkl_dyn_libs]
72+
format!("{}.lib", name)
6473
} else {
6574
match link {
6675
LinkType::Static => {

0 commit comments

Comments
 (0)