@@ -76,11 +76,11 @@ fn main() {
76
76
// This set mi_option_verbose and mi_option_show_errors options to false.
77
77
cfg = cfg. define ( "mi_defines" , "MI_DEBUG=0" ) ;
78
78
79
- let is_debug = match get_cmake_build_type ( ) {
80
- Ok ( CMakeBuildType :: Debug ) => true ,
81
- Ok ( CMakeBuildType :: Release ) => false ,
82
- Ok ( CMakeBuildType :: RelWithDebInfo ) => false ,
83
- Ok ( CMakeBuildType :: MinSizeRel ) => false ,
79
+ let ( is_debug, win_folder ) = match get_cmake_build_type ( ) {
80
+ Ok ( CMakeBuildType :: Debug ) => ( true , "Debug" ) ,
81
+ Ok ( CMakeBuildType :: Release ) => ( false , "Release" ) ,
82
+ Ok ( CMakeBuildType :: RelWithDebInfo ) => ( false , "RelWithDebInfo" ) ,
83
+ Ok ( CMakeBuildType :: MinSizeRel ) => ( false , "MinSizeRel" ) ,
84
84
Err ( e) => panic ! ( "Cannot determine CMake build type: {}" , e) ,
85
85
} ;
86
86
@@ -99,32 +99,37 @@ fn main() {
99
99
}
100
100
}
101
101
102
- let ( out_dir, out_name) = if cfg ! ( all( windows, target_env = "msvc" ) ) {
102
+ let mut out_dir = "./build" . to_string ( ) ;
103
+ if cfg ! ( all( windows, target_env = "msvc" ) ) {
104
+ out_dir. push_str ( "/" ) ;
105
+ out_dir. push_str ( win_folder) ;
106
+ }
107
+ let out_name = if cfg ! ( all( windows, target_env = "msvc" ) ) {
103
108
if is_debug {
104
109
if cfg ! ( feature = "secure" ) {
105
- ( "./build/Debug" , " mimalloc-static-secure-debug")
110
+ " mimalloc-static-secure-debug"
106
111
} else {
107
- ( "./build/Debug" , " mimalloc-static-debug")
112
+ " mimalloc-static-debug"
108
113
}
109
114
} else {
110
115
if cfg ! ( feature = "secure" ) {
111
- ( "./build/Release" , " mimalloc-static-secure")
116
+ " mimalloc-static-secure"
112
117
} else {
113
- ( "./build/Release" , " mimalloc-static")
118
+ " mimalloc-static"
114
119
}
115
120
}
116
121
} else {
117
122
if is_debug {
118
123
if cfg ! ( feature = "secure" ) {
119
- ( "./build" , " mimalloc-secure-debug")
124
+ " mimalloc-secure-debug"
120
125
} else {
121
- ( "./build" , " mimalloc-debug")
126
+ " mimalloc-debug"
122
127
}
123
128
} else {
124
129
if cfg ! ( feature = "secure" ) {
125
- ( "./build" , " mimalloc-secure")
130
+ " mimalloc-secure"
126
131
} else {
127
- ( "./build" , " mimalloc")
132
+ " mimalloc"
128
133
}
129
134
}
130
135
} ;
0 commit comments