aboutsummaryrefslogtreecommitdiff
path: root/src/tomo.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-06-24 13:44:41 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-06-24 13:44:41 -0400
commit6e50989b21214c107b5075782a070e3df25aa333 (patch)
treef14be1dda04ba95481b86aa0c58102f05e04c337 /src/tomo.c
parent271017ba9970e4220e1bd0dc83ce146afe9222a2 (diff)
Correctly detect changes to `use`d C/header files and trigger
recompilation
Diffstat (limited to 'src/tomo.c')
-rw-r--r--src/tomo.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/tomo.c b/src/tomo.c
index b534c491..32acf8e6 100644
--- a/src/tomo.c
+++ b/src/tomo.c
@@ -647,9 +647,21 @@ void build_file_dependency_graph(Path_t path, Table_t *to_compile, Table_t *to_l
asm_path = Path$concat(Path$parent(path), asm_path);
Text_t linker_text = Path$as_text(&asm_path, NULL, &Path$info);
Table$set(to_link, &linker_text, NULL, Table$info(&Text$info, &Void$info));
+ if (is_stale(build_file(path, ".o"), asm_path, false)) {
+ staleness.o = true;
+ Table$set(to_compile, &path, &staleness, Table$info(&Path$info, &Byte$info));
+ }
+ break;
+ }
+ case USE_HEADER: case USE_C_CODE: {
+ Path_t dep_path = Path$from_str(use->path);
+ if (is_stale(build_file(path, ".o"), dep_path, false)) {
+ staleness.o = true;
+ Table$set(to_compile, &path, &staleness, Table$info(&Path$info, &Byte$info));
+ }
break;
}
- default: case USE_HEADER: break;
+ default: break;
}
}
}