Skip to content

Commit 02354b2

Browse files
committed
Fix static linking
1 parent 146cff6 commit 02354b2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sdl2-sys/build.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -244,29 +244,29 @@ fn link_sdl2(target_os: &str) {
244244
if cfg!(feature = "bundled")
245245
|| (cfg!(feature = "use-pkgconfig") == false && cfg!(feature = "use-vcpkg") == false)
246246
{
247-
println!("cargo:rustc-link-lib=SDL2main");
247+
println!("cargo:rustc-link-lib=static=SDL2main");
248248
if target_os == "windows-msvc" {
249-
println!("cargo:rustc-link-lib=SDL2-static");
249+
println!("cargo:rustc-link-lib=static=SDL2-static");
250250
} else {
251-
println!("cargo:rustc-link-lib=SDL2");
251+
println!("cargo:rustc-link-lib=static=SDL2");
252252
}
253253

254-
// bundled not support the other feature
254+
// Additional SDL libraries are not supported when using "bundled"
255255
if !cfg!(feature = "bundled") {
256256
if cfg!(feature = "gfx") {
257-
println!("cargo:rustc-link-lib=SDL2_gfx");
257+
println!("cargo:rustc-link-lib=static=SDL2_gfx");
258258
}
259259

260260
if cfg!(feature = "mixer") {
261-
println!("cargo:rustc-link-lib=SDL2_mixer");
261+
println!("cargo:rustc-link-lib=static=SDL2_mixer");
262262
}
263263

264264
if cfg!(feature = "image") {
265-
println!("cargo:rustc-link-lib=SDL2_image");
265+
println!("cargo:rustc-link-lib=static=SDL2_image");
266266
}
267267

268268
if cfg!(feature = "ttf") {
269-
println!("cargo:rustc-link-lib=SDL2_ttf");
269+
println!("cargo:rustc-link-lib=static=SDL2_ttf");
270270
}
271271
}
272272
}

0 commit comments

Comments
 (0)