Skip to content

Commit 22a8c31

Browse files
authored
Merge pull request #1397 from sandydoo/fix-static-linking
Fix static linking
2 parents 79f9ac7 + 02354b2 commit 22a8c31

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
@@ -245,29 +245,29 @@ fn link_sdl2(target_os: &str) {
245245
if cfg!(feature = "bundled")
246246
|| (cfg!(feature = "use-pkgconfig") == false && cfg!(feature = "use-vcpkg") == false)
247247
{
248-
println!("cargo:rustc-link-lib=SDL2main");
248+
println!("cargo:rustc-link-lib=static=SDL2main");
249249
if target_os == "windows-msvc" {
250-
println!("cargo:rustc-link-lib=SDL2-static");
250+
println!("cargo:rustc-link-lib=static=SDL2-static");
251251
} else {
252-
println!("cargo:rustc-link-lib=SDL2");
252+
println!("cargo:rustc-link-lib=static=SDL2");
253253
}
254254

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

261261
if cfg!(feature = "mixer") {
262-
println!("cargo:rustc-link-lib=SDL2_mixer");
262+
println!("cargo:rustc-link-lib=static=SDL2_mixer");
263263
}
264264

265265
if cfg!(feature = "image") {
266-
println!("cargo:rustc-link-lib=SDL2_image");
266+
println!("cargo:rustc-link-lib=static=SDL2_image");
267267
}
268268

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

0 commit comments

Comments
 (0)