<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 18, 2019 at 9:35 AM Domen Vrankar <<a href="mailto:domen.vrankar@gmail.com">domen.vrankar@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>I'm building llvm project with CMake.</div><div>While build process is compiling the code I prefer running "make -j3" on my 4 core pc (bumping processor to 100% on 3 of 4 cores and using up ~5 GB of ram - part of it is system and not build related).</div><div>While build process is linking I must run "make" with a single job because otherwise I run out of memory (cores do little work but ram usage goes past 23 GB).</div><div><br></div><div>Currently I'm handling this so that I first run "make -j3" and once I get to about 90% (first larger linking) I hit ctrl+c and run "make".</div><div><br></div><div>Is there a feature in CMake that would support handling this transition of parallel builds, sequential linking out of the box?</div><div>(while I'm mostly interested in Linux/make support, having the same feature for Windows/nmake/ninja through the same command line cmake command would be even better) </div></div></blockquote></div><div><br></div><div>This is available for Ninja with the <a href="https://cmake.org/cmake/help/latest/prop_tgt/JOB_POOL_LINK.html">JOB_POOL_LINK</a> target property, the default for which can be set project-wide with the <a href="https://cmake.org/cmake/help/latest/variable/CMAKE_JOB_POOL_LINK.html">CMAKE_JOB_POOL_LINK</a> variable. You can control the number of parallel jobs for a given pool with the <a href="https://cmake.org/cmake/help/latest/prop_gbl/JOB_POOLS.html">JOB_POOLS</a> global property.</div><div><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div><div><br></div><div>Get the hand-book for every CMake user: <a href="https://crascit.com/professional-cmake/" target="_blank">Professional CMake: A Practical Guide</a><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>