From 02ac66792cb11e6b99c63bbe292d28acf6f97990 Mon Sep 17 00:00:00 2001 From: maik Date: Fri, 21 Jun 2019 10:13:17 +0200 Subject: [PATCH] Abort on non mac/ios platforms --- build.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build.rs b/build.rs index f10935c..db99b3e 100644 --- a/build.rs +++ b/build.rs @@ -16,10 +16,17 @@ fn is_external_enabled() -> bool { .is_some() } fn main() { + if !(cfg!(target = "macos") || cfg!(target = "ios")) { + panic!("ash-molten can only be built on macOS or of iOS"); + } // The 'external' feature was not enabled. Molten will be built automaticaly. if !is_external_enabled() { - std::process::Command::new("bash").arg("build_molten.sh").status().expect("Unable to build molten"); - let project_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()).join("native"); + std::process::Command::new("bash") + .arg("build_molten.sh") + .status() + .expect("Unable to build molten"); + let project_dir = + PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()).join("native"); println!("cargo:rustc-link-search=native={}", project_dir.display()); } println!("cargo:rustc-link-lib=framework=Metal");