• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2016 The vulkano developers
2 // Licensed under the Apache License, Version 2.0
3 // <LICENSE-APACHE or
4 // https://www.apache.org/licenses/LICENSE-2.0> or the MIT
5 // license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
6 // at your option. All files in the project carrying such
7 // notice may not be copied, modified, or distributed except
8 // according to those terms.
9 
10 use std::{env, fs::File, io::BufWriter, path::Path};
11 
12 mod autogen;
13 
main()14 fn main() {
15     let target = env::var("TARGET").unwrap();
16     if target.contains("apple-ios") {
17         println!("cargo:rustc-link-search=framework=/Library/Frameworks/");
18         println!("cargo:rustc-link-lib=c++");
19         println!("cargo:rustc-link-lib=framework=MoltenVK");
20         println!("cargo:rustc-link-lib=framework=Metal");
21         println!("cargo:rustc-link-lib=framework=IOSurface");
22         println!("cargo:rustc-link-lib=framework=QuartzCore");
23         println!("cargo:rustc-link-lib=framework=UIKit");
24         println!("cargo:rustc-link-lib=framework=Foundation");
25     }
26 
27     // Write autogen.rs
28     println!("cargo:rerun-if-changed=vk.xml");
29     let path = Path::new(&env::var_os("OUT_DIR").unwrap()).join("autogen.rs");
30     let mut writer = BufWriter::new(File::create(path).unwrap());
31     autogen::write(&mut writer);
32 }
33