aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-08-10 14:53:11 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-08-10 14:53:11 -0400
commit1849e6c9542fc127149d4e855064e8a63c25bc8a (patch)
tree5a978fbda82ac5a017c016669585b29f50a2ae94
parent611ebeab13b64d505ad4b44d0f80b3d0e9fb8dba (diff)
Bugfixes for installation of libraries (incorrect handling of `use` for
C files and headers)
-rw-r--r--src/tomo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tomo.c b/src/tomo.c
index 734abfc3..f60e7427 100644
--- a/src/tomo.c
+++ b/src/tomo.c
@@ -284,11 +284,11 @@ int main(int argc, char *argv[])
pid_t child = fork();
if (child == 0) {
build_library(*lib);
+ if (should_install)
+ install_library(*lib);
_exit(0);
}
wait_for_child_success(child);
- if (should_install)
- install_library(*lib);
}
if (files.length <= 0 && uninstall.length <= 0 && libraries.length <= 0) {
@@ -674,7 +674,10 @@ void build_file_dependency_graph(Path_t path, Table_t *to_compile, Table_t *to_l
break;
}
case USE_HEADER: case USE_C_CODE: {
- Path_t dep_path = Path$from_str(use->path);
+ if (use->path[0] == '<')
+ break;
+
+ Path_t dep_path = Path$resolved(Path$from_str(use->path), Path$parent(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));