@@ -293,6 +293,7 @@ fn patch_sdl2(sdl2_source_path: &Path) {
293
293
#[ cfg( feature = "bundled" ) ]
294
294
fn compile_sdl2 ( sdl2_build_path : & Path , target_os : & str ) -> PathBuf {
295
295
let mut cfg = cmake:: Config :: new ( sdl2_build_path) ;
296
+ cfg. profile ( "release" ) ;
296
297
297
298
// Override __FLTUSED__ to keep the _fltused symbol from getting defined in the static build.
298
299
// This conflicts and fails to link properly when building statically on Windows, likely due to
@@ -410,24 +411,11 @@ fn link_sdl2(target_os: &str) {
410
411
411
412
#[ cfg( feature = "static-link" ) ]
412
413
{
413
- // There's no way to extract this from `cmake::Config` so we have to emulate their
414
- // behaviour here (see the source for `cmake::Config::build`).
415
- let debug_postfix = match (
416
- & env:: var ( "OPT_LEVEL" ) . unwrap_or_default ( ) [ ..] ,
417
- & env:: var ( "PROFILE" ) . unwrap_or_default ( ) [ ..] ,
418
- ) {
419
- ( "1" , _) | ( "2" , _) | ( "3" , _) | ( "s" , _) | ( "z" , _) => "" ,
420
- ( "0" , _) => "d" ,
421
- ( _, "debug" ) => "d" ,
422
- // ("0", _) => "",
423
- // (_, "debug") => "",
424
- ( _, _) => "" ,
425
- } ;
426
414
if cfg ! ( feature = "bundled" )
427
415
|| ( cfg ! ( feature = "use-pkgconfig" ) == false && cfg ! ( feature = "use-vcpkg" ) == false )
428
416
{
429
- println ! ( "cargo:rustc-link-lib=static=SDL2main{}" , debug_postfix ) ;
430
- println ! ( "cargo:rustc-link-lib=static=SDL2{}" , debug_postfix ) ;
417
+ println ! ( "cargo:rustc-link-lib=static=SDL2main" ) ;
418
+ println ! ( "cargo:rustc-link-lib=static=SDL2" ) ;
431
419
}
432
420
433
421
// Also linked to any required libraries for each supported platform
0 commit comments