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

Dave Milter davemilter at gmail.com
Sun Jul 28 20:36:06 EDT 2019


Hi,

On Mon, Jul 29, 2019 at 12:01 AM Alan W. Irwin
<Alan.W.Irwin1234 at gmail.com> wrote:
>
> On 2019-07-28 19:03+0300 Dave Milter wrote:
>
> To help answer your question, I see no fundamental issues with your code above.
>
> If the latter is really true, that appears to me to be a CMake bug
> (although I cannot make the final judgement call on that since I am an
> experienced CMake user rather than a CMake developer).  And if so, does that
> same problem (unnecessary delay in compilation rather than linking)
> occur for the following simplified case?
>

In fact my code in previous email is demo code. It already contains
"sleep" inside lib_generator.sh to emulate
real project.
I am just not sure is this good idea to send attachment into this mailing list.
See attachment, it is possible only to build on Linux/Mac, because of
usage bash/gcc for lib_geneator.sh

And I am pretty sure that problem in cmake (or my usage of cmake),
because of build.ninja generated by cmake contains such rules:
```
build cmake_object_order_depends_target_app: phony || extern_lib_target

build CMakeFiles/app.dir/main.cpp.o: CXX_COMPILER__app ../main.cpp ||
cmake_object_order_depends_target_app
```
"||" is "order-only dependencies" according to
https://ninja-build.org/manual.html#_syntax_example .
So cmake instruct ninja do not build main.cpp.o untill extern_lib_target build.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_library_imported.tar.gz
Type: application/gzip
Size: 1046 bytes
Desc: not available
URL: <https://cmake.org/pipermail/cmake/attachments/20190729/b165e162/attachment.gz>


More information about the CMake mailing list