Skip to content

Commit 5298b52

Browse files
committed
Add cargo::rerun-if-changed directives for source directories
1 parent 5defa79 commit 5298b52

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: profiler_builtins/build.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ fn main() {
1717
let target_env = env::var("CARGO_CFG_TARGET_ENV").expect("CARGO_CFG_TARGET_ENV was not set");
1818
let cfg = &mut cc::Build::new();
1919

20-
// FIXME: `rerun-if-changed` directives are not currently emitted and the build script
21-
// will not rerun on changes in these source files or headers included into them.
2220
let profile_sources = vec![
2321
// tidy-alphabetical-start
2422
"GCDAProfiling.c",
@@ -86,6 +84,7 @@ fn main() {
8684

8785
let src_root = root.join("lib").join("profile");
8886
assert!(src_root.exists(), "profiler runtime source directory not found: {src_root:?}");
87+
println!("cargo::rerun-if-changed={}", src_root.display());
8988
let mut n_sources_found = 0u32;
9089
for src in profile_sources {
9190
let path = src_root.join(src);
@@ -96,7 +95,10 @@ fn main() {
9695
}
9796
assert!(n_sources_found > 0, "couldn't find any profiler runtime source files in {src_root:?}");
9897

99-
cfg.include(root.join("include"));
98+
let include = root.join("include");
99+
println!("cargo::rerun-if-changed={}", include.display());
100+
cfg.include(include);
101+
100102
cfg.warnings(false);
101103
cfg.compile("profiler-rt");
102104
}

0 commit comments

Comments
 (0)