Search code examples
rustembedded-resourcerust-cargo

How can I tell Cargo to rebuild when a file included with the include_bytes macro is changed?


I am using the include_bytes! macro to compile a GLSL shader into a rust program. It seems that Cargo is unaware of this however: when I modify just the shader file and test it with cargo run the updated file is not compiled in. Manually touching the .rs file that includes the shader does work.

Do I need to add something to my Cargo.toml to explictly state this dependency?

Version info:

$ rustc --version && cargo --version
rustc 1.0.0-nightly (ecf8c64e1 2015-03-21) (built 2015-03-22)
cargo 0.0.1-pre-nightly (e689383 2015-03-16) (built 2015-03-16)

Solution

  • This has been fixed in rustc: https://github.com/rust-lang/rust/pull/24423