diff options
Diffstat (limited to 'build.rs')
| -rw-r--r-- | build.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/build.rs b/build.rs index 7399346..ce74854 100644 --- a/build.rs +++ b/build.rs @@ -14,6 +14,7 @@ fn main() { fn process_all() -> std::io::Result<()> { process_shaders()?; process_textures()?; + process_models()?; Ok(()) } @@ -81,3 +82,24 @@ fn process_textures() -> std::io::Result<()> { Ok(()) } + +fn process_models() -> std::io::Result<()> { + for input in fs::read_dir("models")? { + let input_path = input?.path(); + if !input_path.is_file() { + continue; + } + + if let Some(Some(filename)) = input_path.file_name() + .map(|name| name.to_str()) + && filename.get(.. 1) == Some(".") + { + continue; + } + + println!("cargo::rerun-if-changed={}", input_path.display()); + } + + Ok(()) +} + |