Files
DS4Server/build.rs

33 lines
1.0 KiB
Rust

use std::path::Path;
fn main() {
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("macos") {
return;
}
let metal = Path::new("native/metal/ds4_metal.m");
println!("cargo:rerun-if-changed=native/metal");
cc::Build::new()
.include("native/metal")
.file(metal)
.flag("-fobjc-arc")
.opt_level(3)
.compile("ds4_metal");
println!("cargo:rerun-if-changed=native/media");
cc::Build::new()
.file("native/media/ds4_media.m")
.flag("-fobjc-arc")
.compile("ds4_media");
println!("cargo:rerun-if-changed=native/web");
cc::Build::new()
.include("native/web")
.file("native/web/ds4_web.c")
.opt_level(2)
.compile("ds4_web");
println!("cargo:rustc-link-lib=framework=Foundation");
println!("cargo:rustc-link-lib=framework=AppKit");
println!("cargo:rustc-link-lib=framework=AVFoundation");
println!("cargo:rustc-link-lib=framework=AVKit");
println!("cargo:rustc-link-lib=framework=Metal");
}