[cmake-developers] How to use JOB_POOLS?

Dave Abrahams dave at boostpro.com
Mon Nov 21 17:00:11 EST 2016


on Mon Nov 21 2016, Brad King <brad.king-AT-kitware.com> wrote:

> On 11/21/2016 11:06 AM, Dave Abrahams wrote:
>> the documentation for JOB_POOLS is sparse
>
> Yes, it is bare-bones reference documentation for someone that already
> knows how Ninja job pools work.  

I know perfectly well how Ninja job pools work.  The docs in CMake are
inadequate for understanding how CMake interacts with them.

> A sufficiently motivated contributor could add more to the
> `Help/generator/Ninja.rst` document in a new "Job Pools" section.

I do appreciate the hint, Brad, but I'm currently unable to make
contributions to arbitrary open-source projects.

>> I understand the principle at work, but it's really unclear
>> how JOB_POOL_LINK and JOB_POOL_COMPILE are supposed to work when set
>> per-target.
>
> They assign link rules and compile rules for that target to the
> named pool.  Each pool can have a different size assigned in the
> global JOB_POOLS property.  Different targets could be in different
> pools, though typically the global settings are sufficient.

Ah.

>> I presume means compilation of languages that CMake knows about?
>
> Yes.  It is for the compilation and linking commands that CMake
> generates.
>
>> what about custom targets?
>
> We currently have no interface to assign custom commands or
> custom targets to any pool, simply because no one implemented
> such support.  It would have to be a new optional argument to
> the add_custom_command and add_custom_target commands.

Wow, that's too bad.  It gets kinda awkward when my Swift build, which
uses distcc over 100 cpus for C++ compilation, tries to do 100 parallel
swift compilations (not supported by distcc) on my poor local 4-core
machine.

I may have to resort to postprocessing the generated Ninja files if
I can't modify CMake.

-- 
-Dave


More information about the cmake-developers mailing list