Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cross compilation #937

Merged
merged 2 commits into from
Nov 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions sdl2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,11 @@ fn link_sdl2(target_os: &str) {
// -lSDL2_mixer can find it.
#[cfg(all(not(feature = "use-pkgconfig"), not(feature = "static-link")))] {
if cfg!(feature = "mixer") {
if cfg!(any(target_os="linux", target_os="freebsd", target_os="openbsd")) {
if target_os.contains("linux") || target_os.contains("freebsd") || target_os.contains("openbsd") {
println!("cargo:rustc-flags=-l SDL2_mixer");
} else if cfg!(target_os="windows") {
} else if target_os.contains("windows") {
println!("cargo:rustc-flags=-l SDL2_mixer");
} else if cfg!(target_os="macos") {
} else if target_os.contains("darwin") {
if cfg!(any(mac_framework, feature="use_mac_framework")) {
println!("cargo:rustc-flags=-l framework=SDL2_mixer");
} else {
Expand All @@ -364,11 +364,11 @@ fn link_sdl2(target_os: &str) {
}
}
if cfg!(feature = "image") {
if cfg!(any(target_os="linux", target_os="freebsd", target_os="openbsd")) {
if target_os.contains("linux") || target_os.contains("freebsd") || target_os.contains("openbsd") {
println!("cargo:rustc-flags=-l SDL2_image");
} else if cfg!(target_os="windows") {
} else if target_os.contains("windows") {
println!("cargo:rustc-flags=-l SDL2_image");
} else if cfg!(target_os="macos") {
} else if target_os.contains("darwin") {
if cfg!(any(mac_framework, feature="use_mac_framework")) {
println!("cargo:rustc-flags=-l framework=SDL2_image");
} else {
Expand All @@ -377,11 +377,11 @@ fn link_sdl2(target_os: &str) {
}
}
if cfg!(feature = "ttf") {
if cfg!(any(target_os="linux", target_os="freebsd", target_os="openbsd")) {
if target_os.contains("linux") || target_os.contains("freebsd") || target_os.contains("openbsd") {
println!("cargo:rustc-flags=-l SDL2_ttf");
} else if cfg!(target_os="windows") {
} else if target_os.contains("windows") {
println!("cargo:rustc-flags=-l SDL2_ttf");
} else if cfg!(target_os="macos") {
} else if target_os.contains("darwin") {
if cfg!(any(mac_framework, feature="use_mac_framework")) {
println!("cargo:rustc-flags=-l framework=SDL2_ttf");
} else {
Expand All @@ -390,11 +390,11 @@ fn link_sdl2(target_os: &str) {
}
}
if cfg!(feature = "gfx") {
if cfg!(any(target_os="linux", target_os="freebsd", target_os="openbsd")) {
if target_os.contains("linux") || target_os.contains("freebsd") || target_os.contains("openbsd") {
println!("cargo:rustc-flags=-l SDL2_gfx");
} else if cfg!(target_os="windows") {
} else if target_os.contains("windows") {
println!("cargo:rustc-flags=-l SDL2_gfx");
} else if cfg!(target_os="macos") {
} else if target_os.contains("darwin") {
if cfg!(any(mac_framework, feature="use_mac_framework")) {
println!("cargo:rustc-flags=-l framework=SDL2_gfx");
} else {
Expand Down