[CMake] cmake + ninja how to use several CPU cores?

Dave Milter davemilter at gmail.com
Mon Jul 29 16:25:32 EDT 2019


On Mon, Jul 29, 2019 at 10:32 PM Brad King <brad.king at kitware.com> wrote:
>
> Even if we had that information we don't know what `main.cpp` includes
> until after compiling it, by which point it is too late.  It could have
> `#include "anything.txt"` for example.  CMake must add these pessimistic
> dependencies to ensure a correct build.
>
> The only way to avoid this is to tell CMake that there are no dependencies
> for compiling an object file by moving it to an object library that does
> not depend on any of the targets with custom commands.
>

But my custom command OUTPUT is shared library,
and in my case it would be strange to '#include' it into some source file.
So what about EXPLICIT_DEPENDS_ONLY mentioned
https://gitlab.kitware.com/cmake/cmake/issues/17097
to mark something that no way to be included into source file?


More information about the CMake mailing list