From c2b15c989e7bc675d6c1482cf3580f92af984e56 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Mon, 28 Oct 2019 16:46:57 +0100 Subject: [PATCH] Pin MoltenVK version to v1.0.37 (#5) --- Cargo.toml | 2 +- README.md | 13 ++++++++++++- build.rs | 11 +++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eb1791e..5a0f535 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ash-molten" description = "Statically linked MoltenVK for Vulkan on Mac using Ash" -version = "0.1.0" +version = "0.2.0+37" authors = ["Embark ", "Maik Klein "] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/README.md b/README.md index 4d3919f..dc7059e 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,20 @@ You can run the example with `cargo run`. ### Features -`cargo build` will clone the newest master of [MoltenVK](https://github.com/KhronosGroup/MoltenVK) compile and statically link it with your application. +`cargo build` will clone a specific release of [MoltenVK](https://github.com/KhronosGroup/MoltenVK) compile and statically link it with your application. + If you want to compile [MoltenVK](https://github.com/KhronosGroup/MoltenVK) yourself, you can use the `external` feature. `cargo build --features external` requires `libMoltenVK` to be visible (`LD_LIBRARY_PATH`). +### How to update + +To update the version of [MoltenVK](https://github.com/KhronosGroup/MoltenVK) uses, change the following: + +- In `build.rs`, change `let tag = "v1.0.37"` to the new [MoltenVK release](https://github.com/KhronosGroup/MoltenVK/releases) tag name +- Update the crate version in `Cargo.toml` + - Bump the patch version + - Set the version metadata to the MoltenVK release. + - E.g. `0.2.0+37` -> `0.2.1+38`. + ## Contributing We welcome community contributions to this project. diff --git a/build.rs b/build.rs index 6e2cfad..f4e70e5 100644 --- a/build.rs +++ b/build.rs @@ -28,8 +28,11 @@ mod mac { }, }; - let checkout_dir = - Path::new(&std::env::var("OUT_DIR").expect("Couldn't find OUT_DIR")).join("MoltenVK"); + // MoltenVK git tagged release to use + let tag = "v1.0.37"; + + let checkout_dir = Path::new(&std::env::var("OUT_DIR").expect("Couldn't find OUT_DIR")) + .join(format!("MoltenVK-{}", tag)); let exit = Arc::new(AtomicBool::new(false)); let wants_exit = exit.clone(); @@ -59,6 +62,10 @@ mod mac { } else { Command::new("git") .arg("clone") + .arg("--branch") + .arg(tag.to_owned()) + .arg("--depth") + .arg("1") .arg("https://github.com/KhronosGroup/MoltenVK.git") .arg(&checkout_dir) .spawn()