Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[workspace]
members = [
"spirv-tools-sys",
"tools/generate",
"tools/package",
"tools/install"
"tools/install",
]

[package]
Expand Down
23 changes: 0 additions & 23 deletions spirv-tools-sys/generate.sh

This file was deleted.

11 changes: 11 additions & 0 deletions tools/generate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "generate"
version = "0.1.0"
edition = "2021"
publish = false

[[bin]]
name = "generate"
path = "main.rs"
test = false
bench = false
5 changes: 4 additions & 1 deletion spirv-tools-sys/generate.rs → tools/generate/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// to in a simple script and commit them to source control, as they only need
// to be regenerated when spirv-headers is updated

use std::path::PathBuf;
use std::{fs, process::Command};

fn python<S: AsRef<std::ffi::OsStr>>(args: impl IntoIterator<Item = S>) -> Result<(), i32> {
Expand All @@ -20,7 +21,9 @@ fn python<S: AsRef<std::ffi::OsStr>>(args: impl IntoIterator<Item = S>) -> Resul
}

fn main() {
fs::create_dir_all("generated").expect("unable to create 'generated'");
let sys_root = PathBuf::from_iter([env!("CARGO_MANIFEST_DIR"), "..", "..", "spirv-tools-sys"]);
fs::create_dir_all(&sys_root.join("generated")).expect("unable to create 'generated'");
std::env::set_current_dir(&sys_root).unwrap();

python(&[
"spirv-tools/utils/update_build_version.py",
Expand Down
6 changes: 6 additions & 0 deletions tools/generate/vulkan-sdk-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Vulkan sdk update

1. in `.gitmodules` set branch for both submodules to the new vulkan sdk version's branch
2. update submodules: `git submodule update --remote`
3. regenerate generated header files, requires python: `cargo run generate`
4. try to compile and run the tests, fixup any errors: `cargo test --all-features`