1
0
Fork 0
forked from wry/wry

Merge pull request #632 from mahkoh/jorth/simplify-compile-shaders

build.rs: simplify compile-shaders handling
This commit is contained in:
mahkoh 2025-10-07 16:47:58 +02:00 committed by GitHub
commit 02b7a6dc3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 37 deletions

View file

@ -1,8 +1,13 @@
mod hash;
use {crate::vulkan::hash::unchanged, anyhow::bail, std::process::Command};
use {
crate::vulkan::hash::{ROOT, unchanged},
anyhow::bail,
std::process::Command,
};
pub fn main() -> anyhow::Result<()> {
println!("cargo:rerun-if-changed={}", ROOT);
if !std::fs::exists("compile-shaders")? {
return Ok(());
}
@ -15,7 +20,7 @@ pub fn main() -> anyhow::Result<()> {
"--manifest-path",
"compile-shaders/Cargo.toml",
"-p",
"compile-shaders-build-rs",
"compile-shaders-compile",
])
.status()?;
if !code.success() {

View file

@ -49,14 +49,6 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
[[package]]
name = "compile-shaders-build-rs"
version = "0.1.0"
dependencies = [
"anyhow",
"compile-shaders-core",
]
[[package]]
name = "compile-shaders-compile"
version = "0.1.0"

View file

@ -1,6 +1,6 @@
[workspace]
resolver = "3"
members = ["build-rs", "compile", "core", "shaderc-sys"]
members = ["compile", "core", "shaderc-sys"]
[patch."crates-io"]
shaderc-sys.path = "shaderc-sys"

View file

@ -1,8 +0,0 @@
[package]
name = "compile-shaders-build-rs"
version = "0.1.0"
edition = "2024"
[dependencies]
compile-shaders-core = { path = "../core" }
anyhow = "1.0.99"

View file

@ -1,18 +0,0 @@
use {anyhow::bail, compile_shaders_core::ROOT, std::process::Command};
fn main() -> anyhow::Result<()> {
println!("cargo:rerun-if-changed={}", ROOT);
let code = Command::new("cargo")
.args([
"run",
"--manifest-path",
"compile-shaders/Cargo.toml",
"-p",
"compile-shaders-compile",
])
.status()?;
if !code.success() {
bail!("compile-shaders failed");
}
Ok(())
}