From c8af445d01d66d96b7f364d5ecbd3fe3423a0939 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 26 Apr 2025 16:05:07 -0400 Subject: Install libs as-you-go instead of after all of them are built (in case of serial dependencies) --- src/tomo.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/tomo.c b/src/tomo.c index 61b981fd..3c5b1c55 100644 --- a/src/tomo.c +++ b/src/tomo.c @@ -227,23 +227,18 @@ int main(int argc, char *argv[]) } for (int64_t i = 0; i < libraries.length; i++) { + Path_t *lib = (Path_t*)(libraries.data + i*libraries.stride); // Fork a child process to build the library to prevent cross-contamination // of side effects when building one library from affecting another library. // This *could* be done in parallel, but there may be some dependency issues. pid_t child = fork(); if (child == 0) { - Path_t *lib = (Path_t*)(libraries.data + i*libraries.stride); build_library(*lib); _exit(0); } wait_for_child_success(child); - } - - if (should_install) { - for (int64_t i = 0; i < libraries.length; i++) { - Path_t *lib = (Path_t*)(libraries.data + i*libraries.stride); + if (should_install) install_library(*lib); - } } if (files.length <= 0 && uninstall.length <= 0 && libraries.length <= 0) { -- cgit v1.2.3