-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
20 lines (18 loc) · 809 Bytes
/
build.rs
File metadata and controls
20 lines (18 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std::env;
use std::path::PathBuf;
fn main() {
let os = env::var("CARGO_CFG_TARGET_OS").unwrap();
let arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
if os == "windows" {
if arch != "x86_64" {
println!("cargo:warning=Please replace SDL3.dll and SDL3.lib with x86 or ARM version");
} else {
let project_root_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let lib_dir = PathBuf::from(project_root_dir).join("sdl3_lib");
println!("cargo:rustc-link-search=native={}", lib_dir.display());
}
} else if let Err(e) = pkg_config::Config::new().probe("sdl3") {
println!("cargo:warning=Could not find SDL3 via pkg-config: {}", e);
println!("cargo:warning=Ensure SDL3 is installed on your computer");
}
}