Skip to content

Commit 355a44f

Browse files
Firestar99LegNeato
authored andcommitted
move generate rust script to tools
1 parent 611df9d commit 355a44f

File tree

4 files changed

+17
-25
lines changed

4 files changed

+17
-25
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[workspace]
22
members = [
33
"spirv-tools-sys",
4+
"tools/generate",
45
"tools/package",
5-
"tools/install"
6+
"tools/install",
67
]
78

89
[package]

spirv-tools-sys/generate.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

tools/generate/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "generate"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
7+
[[bin]]
8+
name = "generate"
9+
path = "main.rs"
10+
test = false
11+
bench = false

spirv-tools-sys/generate.rs renamed to tools/generate/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// to in a simple script and commit them to source control, as they only need
44
// to be regenerated when spirv-headers is updated
55

6+
use std::path::PathBuf;
67
use std::{fs, process::Command};
78

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

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

2528
python(&[
2629
"spirv-tools/utils/update_build_version.py",

0 commit comments

Comments
 (0)