blob: 4da24a10d42f9348a47370b75600593fac276c2a [file] [log] [blame]
Jason Macnak08bdde52021-08-30 14:41:47 -07001// 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#![feature(str_split_once)]
11
12use std::{env, fs::File, io::BufWriter, path::Path};
13
14mod autogen;
15
16fn main() {
17 let target = env::var("TARGET").unwrap();
18 if target.contains("apple-ios") {
19 println!("cargo:rustc-link-search=framework=/Library/Frameworks/");
20 println!("cargo:rustc-link-lib=c++");
21 println!("cargo:rustc-link-lib=framework=MoltenVK");
22 println!("cargo:rustc-link-lib=framework=Metal");
23 println!("cargo:rustc-link-lib=framework=IOSurface");
24 println!("cargo:rustc-link-lib=framework=QuartzCore");
25 println!("cargo:rustc-link-lib=framework=UIKit");
26 println!("cargo:rustc-link-lib=framework=Foundation");
27 }
28
29 // Write autogen.rs
30 println!("cargo:rerun-if-changed=vk.xml");
31 let path = Path::new(&env::var_os("OUT_DIR").unwrap()).join("autogen.rs");
32 let mut writer = BufWriter::new(File::create(path).unwrap());
33 autogen::write(&mut writer);
34}