File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -244,11 +244,30 @@ fn link_sdl2(target_os: &str) {
244
244
if cfg ! ( feature = "bundled" )
245
245
|| ( cfg ! ( feature = "use-pkgconfig" ) == false && cfg ! ( feature = "use-vcpkg" ) == false )
246
246
{
247
- println ! ( "cargo:rustc-link-lib=static= SDL2main" ) ;
248
- if target_os. contains ( "windows" ) {
249
- println ! ( "cargo:rustc-link-lib=static= SDL2-static" ) ;
247
+ println ! ( "cargo:rustc-link-lib=SDL2main" ) ;
248
+ if target_os == "windows-msvc" {
249
+ println ! ( "cargo:rustc-link-lib=SDL2-static" ) ;
250
250
} else {
251
- println ! ( "cargo:rustc-link-lib=static=SDL2" ) ;
251
+ println ! ( "cargo:rustc-link-lib=SDL2" ) ;
252
+ }
253
+
254
+ // bundled not support the other feature
255
+ if !cfg ! ( feature = "bundled" ) {
256
+ if cfg ! ( feature = "gfx" ) {
257
+ println ! ( "cargo:rustc-link-lib=SDL2_gfx" ) ;
258
+ }
259
+
260
+ if cfg ! ( feature = "mixer" ) {
261
+ println ! ( "cargo:rustc-link-lib=SDL2_mixer" ) ;
262
+ }
263
+
264
+ if cfg ! ( feature = "image" ) {
265
+ println ! ( "cargo:rustc-link-lib=SDL2_image" ) ;
266
+ }
267
+
268
+ if cfg ! ( feature = "ttf" ) {
269
+ println ! ( "cargo:rustc-link-lib=SDL2_ttf" ) ;
270
+ }
252
271
}
253
272
}
254
273
You can’t perform that action at this time.
0 commit comments