fix(build): make proto/i18n's implicit outputs explicit

This commit is contained in:
llama 2025-11-20 20:25:29 +08:00
parent dda192f24c
commit 74b61d2a1b
No known key found for this signature in database
GPG key ID: 0B7543854B9413C3

View file

@ -335,6 +335,15 @@ pub fn write_file_if_changed(path: impl AsRef<Path>, contents: impl AsRef<[u8]>)
.map(|existing| existing != contents)
.unwrap_or(true)
};
match std::env::var("CARGO_PKG_NAME") {
Ok(pkg) if pkg == "anki_proto" || pkg == "anki_i18n" => {
// at comptime for the proto /i18n crates, register implicit output as output
println!("cargo:rerun-if-changed={}", path.to_str().unwrap());
}
_ => {}
}
if changed {
write_file(path, contents)?;
Ok(true)