diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-06-24 13:44:41 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-06-24 13:44:41 -0400 |
| commit | 6e50989b21214c107b5075782a070e3df25aa333 (patch) | |
| tree | f14be1dda04ba95481b86aa0c58102f05e04c337 | |
| parent | 271017ba9970e4220e1bd0dc83ce146afe9222a2 (diff) | |
Correctly detect changes to `use`d C/header files and trigger
recompilation
| -rw-r--r-- | src/tomo.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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; } } } |
