agb/mgba-test-runner/build.rs
Corwin Kuiper f5625aa825 change 0.9.0 to 0.9
for me 0.9 is a symlink to 0.9.1 at the moment, which should be compatible
2021-05-23 01:34:56 +01:00

22 lines
558 B
Rust

use std::path;
fn find_mgba_library() -> Option<&'static str> {
const POTENTIAL_LIBRARY_LOCATIONS: &[&str] =
&["/usr/lib/libmgba.so.0.9", "/usr/local/lib/libmgba.so.0.9"];
POTENTIAL_LIBRARY_LOCATIONS
.iter()
.find(|file_path| path::Path::new(file_path).exists())
.copied()
}
fn main() {
let mgba_library = find_mgba_library().expect("Need mgba 0.9 installed");
cc::Build::new()
.file("c/test-runner.c")
.object(mgba_library)
.include("c/include")
.compile("test-runner");
}