Skip to content

Commit efaab38

Browse files
author
Evan Benn
committed
README.md: Add note that rerun-if-changed is not emitted.
Issue rust-lang#230 is the issue for this, this patch just documents the current behaviour.
1 parent 53fb72c commit efaab38

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ fn main() {
2828
.file("foo.c")
2929
.file("bar.c")
3030
.compile("foo");
31+
println!("cargo:rerun-if-changed=foo.c");
32+
println!("cargo:rerun-if-changed=bar.c");
3133
}
3234
```
3335

@@ -101,6 +103,10 @@ functions with hard requirements on some variables supplied by [cargo's
101103
build-script driver][cargo] that it has the `TARGET`, `OUT_DIR`, `OPT_LEVEL`,
102104
and `HOST` variables.
103105

106+
Note that `cc-rs` does not automatically tell cargo to rebuild when the c files
107+
are changed, nor the environment variables such as CFLAGS. See the example to
108+
manually instruct cargo to rebuild when the source files change.
109+
104110
[cargo]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#inputs-to-the-build-script
105111

106112
## Optional features

0 commit comments

Comments
 (0)