Skip to content

Commit 274c5a7

Browse files
authored
Rerun ark's build.rs on changes to src/ or resources/ (#777)
1 parent 63a270d commit 274c5a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/ark/build.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ use std::process::Command;
1010
extern crate embed_resource;
1111

1212
fn main() {
13+
// Ensures that env vars are refreshed on any `src/` or `resources/` change, which is
14+
// required for `.ps.ark.version()` to work as you'd expect. Notably this also ensures
15+
// changes to `src/debug.c` force a refresh, which otherwise aren't considered by
16+
// cargo's defaults as requiring a rebuild.
17+
println!("cargo:rerun-if-changed=src");
18+
println!("cargo:rerun-if-changed=resources");
19+
1320
// Attempt to use `git rev-parse HEAD` to get the current git hash. If this
1421
// fails, we'll just use the string "<unknown>" to indicate that the git hash
1522
// could not be determined..
@@ -60,6 +67,5 @@ fn main() {
6067
.join("ark-manifest.rc");
6168
embed_resource::compile_for_everything(resource, embed_resource::NONE);
6269

63-
println!("cargo:rerun-if-changed=src/debug.c");
6470
cc::Build::new().file("src/debug.c").compile("debug");
6571
}

0 commit comments

Comments
 (0)