@@ -77,14 +77,11 @@ fn main() {
77
77
let feat_window = env:: var ( "CARGO_FEATURE_WINDOW" ) . is_ok ( ) ;
78
78
let feat_graphics = env:: var ( "CARGO_FEATURE_GRAPHICS" ) . is_ok ( ) ;
79
79
let mut cmake = cmake:: Config :: new ( "SFML" ) ;
80
- let cmake_debug = cmake. get_profile ( ) == "Debug" ;
81
- let msvc_rt = if cmake_debug {
82
- "MultiThreadedDebug"
83
- } else {
84
- "MultiThreaded"
85
- } ;
80
+ // Due to complications with static linking of MSVC runtime (debug version),
81
+ // we cannot support debug builds of SFML.
82
+ cmake. profile ( "Release" ) ;
86
83
cmake
87
- . define ( "CMAKE_MSVC_RUNTIME_LIBRARY" , msvc_rt )
84
+ . define ( "CMAKE_MSVC_RUNTIME_LIBRARY" , "MultiThreaded" )
88
85
. define ( "SFML_USE_STATIC_STD_LIBS" , "TRUE" )
89
86
. define ( "BUILD_SHARED_LIBS" , "FALSE" )
90
87
. define ( "SFML_BUILD_NETWORK" , "FALSE" )
@@ -187,11 +184,7 @@ fn main() {
187
184
// I have no idea why this is different on Windows and Linux
188
185
let win_env = WinEnv :: get ( ) ;
189
186
let link_search = if matches ! ( win_env, Some ( WinEnv :: Msvc ) ) {
190
- if cmake_debug {
191
- "build/lib/Debug"
192
- } else {
193
- "build/lib/Release"
194
- }
187
+ "build/lib/Release"
195
188
} else {
196
189
"build/lib"
197
190
} ;
@@ -200,7 +193,7 @@ fn main() {
200
193
path. join( link_search) . display( )
201
194
) ;
202
195
println ! ( "cargo:rustc-link-lib=static=rcsfml" ) ;
203
- link_sfml_subsystem ( "system" , cmake_debug ) ;
196
+ link_sfml_subsystem ( "system" ) ;
204
197
if is_unix && is_linux {
205
198
static_link_linux ( feat_window, feat_audio, feat_graphics) ;
206
199
} else if is_windows {
@@ -214,17 +207,16 @@ fn main() {
214
207
}
215
208
}
216
209
if feat_audio {
217
- link_sfml_subsystem ( "audio" , cmake_debug ) ;
210
+ link_sfml_subsystem ( "audio" ) ;
218
211
}
219
212
if feat_window {
220
- link_sfml_subsystem ( "window" , cmake_debug ) ;
213
+ link_sfml_subsystem ( "window" ) ;
221
214
}
222
215
if feat_graphics {
223
- link_sfml_subsystem ( "graphics" , cmake_debug ) ;
216
+ link_sfml_subsystem ( "graphics" ) ;
224
217
}
225
218
}
226
219
227
- fn link_sfml_subsystem ( name : & str , debug : bool ) {
228
- let suffix = if debug { "-d" } else { "" } ;
229
- println ! ( "cargo:rustc-link-lib=static=sfml-{name}-s{suffix}" ) ;
220
+ fn link_sfml_subsystem ( name : & str ) {
221
+ println ! ( "cargo:rustc-link-lib=static=sfml-{name}-s" ) ;
230
222
}
0 commit comments