File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,12 @@ pub fn mkl_libs(cfg: Config) -> Vec<String> {
28
28
}
29
29
} ;
30
30
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
+ }
32
37
}
33
38
34
39
/// MKL Libraries to be loaded dynamically
@@ -45,22 +50,26 @@ pub fn mkl_dyn_libs(cfg: Config) -> Vec<String> {
45
50
libs. push ( "mkl_rt" . into ( ) ) ;
46
51
libs. push ( "mkl_vml_mc2" . into ( ) ) ;
47
52
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
+ }
49
59
}
50
60
}
51
61
}
52
62
53
63
/// Filename convention for MKL libraries.
54
64
pub fn mkl_file_name ( link : LinkType , name : & str ) -> String {
55
65
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)
64
73
} else {
65
74
match link {
66
75
LinkType :: Static => {
You can’t perform that action at this time.
0 commit comments