Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Rebuild shader header when cbindgen sources have changed

Antonio Scandurra0ff5603dc962
diff --git a/crates/gpui/build.rs b/crates/gpui/build.rs
index 24e493cb812..44228b2e752 100644
--- a/crates/gpui/build.rs
+++ b/crates/gpui/build.rs
@@ -70,13 +70,23 @@ fn generate_shader_bindings() -> PathBuf {
]);
config.no_includes = true;
config.enumeration.prefix_with_name = true;
- cbindgen::Builder::new()
- .with_src(crate_dir.join("src/scene.rs"))
- .with_src(crate_dir.join("src/geometry.rs"))
- .with_src(crate_dir.join("src/color.rs"))
- .with_src(crate_dir.join("src/window.rs"))
- .with_src(crate_dir.join("src/platform.rs"))
- .with_src(crate_dir.join("src/platform/mac/metal_renderer.rs"))
+
+ let mut builder = cbindgen::Builder::new();
+
+ let src_paths = [
+ crate_dir.join("src/scene.rs"),
+ crate_dir.join("src/geometry.rs"),
+ crate_dir.join("src/color.rs"),
+ crate_dir.join("src/window.rs"),
+ crate_dir.join("src/platform.rs"),
+ crate_dir.join("src/platform/mac/metal_renderer.rs"),
+ ];
+ for src_path in src_paths {
+ println!("cargo:rerun-if-changed={}", src_path.display());
+ builder = builder.with_src(src_path);
+ }
+
+ builder
.with_config(config)
.generate()
.expect("Unable to generate bindings")