Save memory. Do not link to LLVM libraries in parallel
This Pull request:
Linking to the built-in static LLVM libraries uses a lot of memory. Linking more than one such target in parallel can exhaust the memory. This PR adds dependencies to prevent this.
Compare
https://github.com/root-project/root/blob/a32e7d0eb6ff583c3420e32b4198d20cd7e8ebd4/core/metacling/src/CMakeLists.txt#L126-L127
Thanks for these changes. How much memory is consumed in the worst case? Is some potential for parallelism lost at the risk of some potential reduction of build time?
These dependency hacks are not really great for targeted rebuilds; for example the current hack already results in ninja Cling (which I do quite often) rebuilding also rootcling_stage1. If it's possible to use ninja, we could look into JOB_POOLS in the way that LLVM provides LLVM_PARALLEL_LINK_JOBS.