mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Merge pull request #254 from caryhaynie/osx_pkgconfig_fix
move building via pkg-config to behind a feature.
This commit is contained in:
@@ -8,6 +8,12 @@ build = "build.rs"
|
||||
|
||||
[lib]
|
||||
name = "sdl2-sys"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[build-dependencies]
|
||||
pkg-config = "*"
|
||||
|
||||
[features]
|
||||
|
||||
default = []
|
||||
use-pkgconfig = []
|
||||
|
||||
+6
-2
@@ -1,8 +1,12 @@
|
||||
extern crate "pkg-config" as pkg_config;
|
||||
|
||||
fn main() {
|
||||
if build_pkgconfig() { return; }
|
||||
panic!("Could not find SDL2 via pkgconfig");
|
||||
if std::os::getenv("CARGO_FEATURE_USE_PKGCONFIG").is_some() {
|
||||
if build_pkgconfig() { return; }
|
||||
panic!("Could not find SDL2 via pkgconfig");
|
||||
} else {
|
||||
println!("cargo:rustc-flags=-l SDL2");
|
||||
}
|
||||
}
|
||||
|
||||
fn build_pkgconfig() -> bool {
|
||||
|
||||
Reference in New Issue
Block a user