From 02354b2dd49021d6505c8db4d9b27b453767b6d0 Mon Sep 17 00:00:00 2001 From: Sander Date: Sun, 5 May 2024 20:03:02 +0000 Subject: [PATCH] Fix static linking --- sdl2-sys/build.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sdl2-sys/build.rs b/sdl2-sys/build.rs index 633ad9526d..813b327755 100644 --- a/sdl2-sys/build.rs +++ b/sdl2-sys/build.rs @@ -244,29 +244,29 @@ fn link_sdl2(target_os: &str) { if cfg!(feature = "bundled") || (cfg!(feature = "use-pkgconfig") == false && cfg!(feature = "use-vcpkg") == false) { - println!("cargo:rustc-link-lib=SDL2main"); + println!("cargo:rustc-link-lib=static=SDL2main"); if target_os == "windows-msvc" { - println!("cargo:rustc-link-lib=SDL2-static"); + println!("cargo:rustc-link-lib=static=SDL2-static"); } else { - println!("cargo:rustc-link-lib=SDL2"); + println!("cargo:rustc-link-lib=static=SDL2"); } - // bundled not support the other feature + // Additional SDL libraries are not supported when using "bundled" if !cfg!(feature = "bundled") { if cfg!(feature = "gfx") { - println!("cargo:rustc-link-lib=SDL2_gfx"); + println!("cargo:rustc-link-lib=static=SDL2_gfx"); } if cfg!(feature = "mixer") { - println!("cargo:rustc-link-lib=SDL2_mixer"); + println!("cargo:rustc-link-lib=static=SDL2_mixer"); } if cfg!(feature = "image") { - println!("cargo:rustc-link-lib=SDL2_image"); + println!("cargo:rustc-link-lib=static=SDL2_image"); } if cfg!(feature = "ttf") { - println!("cargo:rustc-link-lib=SDL2_ttf"); + println!("cargo:rustc-link-lib=static=SDL2_ttf"); } } }