Merge pull request #632 from mahkoh/jorth/simplify-compile-shaders
build.rs: simplify compile-shaders handling
This commit is contained in:
commit
02b7a6dc3f
5 changed files with 8 additions and 37 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
8
compile-shaders/Cargo.lock
generated
8
compile-shaders/Cargo.lock
generated
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
@ -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(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue