From efaab38f806badee14673561f0af8590f00090b9 Mon Sep 17 00:00:00 2001 From: Evan Benn Date: Thu, 28 Jul 2022 09:37:25 +1000 Subject: [PATCH] README.md: Add note that rerun-if-changed is not emitted. Issue #230 is the issue for this, this patch just documents the current behaviour. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index b52e095b..642efe52 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ fn main() { .file("foo.c") .file("bar.c") .compile("foo"); + println!("cargo:rerun-if-changed=foo.c"); + println!("cargo:rerun-if-changed=bar.c"); } ``` @@ -101,6 +103,10 @@ functions with hard requirements on some variables supplied by [cargo's build-script driver][cargo] that it has the `TARGET`, `OUT_DIR`, `OPT_LEVEL`, and `HOST` variables. +Note that `cc-rs` does not automatically tell cargo to rebuild when the c files +are changed, nor the environment variables such as CFLAGS. See the example to +manually instruct cargo to rebuild when the source files change. + [cargo]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#inputs-to-the-build-script ## Optional features