[cmake-developers] Race between ADD_CUSTOM_COMMAND()

Oleh Kravchenko oleg at kaa.org.ua
Wed Jul 4 15:21:32 EDT 2018


Hi Nils,
Thank you for your answer!

In my case I can't use target for this.
There are any hard limits which block fixing of this behaviour?

By the way, can I have two and more targets in one build directory?

04.07.18 20:19, Nils Gladitz пише:
> On 04.07.2018 18:52, Oleh Kravchenko wrote:
> 
>> Hello CMake Developers!
>>
>> Looks like I found interesting bug in CMake:
>> - ADD_CUSTOM_TARGET() always creates Makefile rule for ADD_CUSTOM_COMMAND().
>> - As result build simetimes failed if specified -jN for make.
> 
> FWIW this is documented behavior (so not exactly a bug):
> https://cmake.org/cmake/help/latest/command/add_custom_command.html
> 
> "Do not list the output in more than one independent target that may build in parallel or the two instances of the rule may conflict[...]".
> 
> Nils

-- 
Best regards,
Oleh Kravchenko


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20180704/b9cab42f/attachment.sig>


More information about the cmake-developers mailing list