[cmake-developers] Ninja pools

Brad King brad.king at kitware.com
Mon Nov 25 15:30:20 EST 2013


On 11/25/2013 03:09 PM, Peter Kümmel wrote:
> OK, merged a new version to next.
> 
> Now the docu looks much better, thanks!

Great.  Here are a few more comments:

Spelling: s/explicitely/explicitly/g

> +  set_property(GLOBAL PROPERTY JOB_POOLS two_jobs=2 ten_jobs=10).

Remove the trailing "." in a literal block.

> +  set_target_properties(target PROPERTIES JOB_POOL_COMPILE ten_jobs)
> ...
> +  set_target_properties(target PROPERTIES JOB_POOL_LINK two_jobs)

Perhaps instead:

 set_property(TARGET myexe PROPERTY JOB_POOL_COMPILE ten_jobs)
 ...
 set_property(TARGET myexe PROPERTY JOB_POOL_LINK two_jobs)

> +CMAKE_JOB_POOL_LINK
> +----------------------
> +
> +Job pool used for linking.
> ...

The two variables should simply say what they do: initialize the
target properties.  See Help/variable/CMAKE_AUTOMOC.rst for an example.
You can use something like:

 This variable is used to initialize the :prop_tgt:`JOB_POOL_LINK`
 property on all the targets.  See that target property for additional
 information.

> +  this->SetPropertyDefault("JOB_POOL_COMPILE",
> +      this->Makefile->GetDefinition("CMAKE_JOB_POOL_COMPILE"));
> +
> +  this->SetPropertyDefault("JOB_POOL_LINK",
> +      this->Makefile->GetDefinition("CMAKE_JOB_POOL_LINK"));

The purpose of SetPropertyDefault is to lookup the variable for you.
You just need

 this->SetPropertyDefault("JOB_POOL_COMPILE", 0);
 this->SetPropertyDefault("JOB_POOL_LINK", 0);

The second argument is just what to use when the variable is not set.

Brad



More information about the cmake-developers mailing list