[CMake] Ninja and .o targets dependencies on dynamic libraries

Daniel Russel drussel at gmail.com
Mon Jun 17 15:49:45 EDT 2013


The ninja targets generated by cmake for our project have the .o targets
used to build libraries that have order-only dependencies on the dynamic
libraries to which the resulting library will be linked. That is
- libfoo.so is built from foo.o and libbar.so
and
- foo.o has an order-only dependency on libbar.so

Is this dependency really needed (as opposed to having only a dependency
between libfoo.so and libbar.so)? It has the (unfortunate) result that
foo.o can't be built until after libbar.so, reducing parallelism as well as
how far you can go if there is a build error in foo.o. Thanks.

References

Output of ninja -browse:
modules/atom/src/CMakeFiles/imp_atom.dir/__/__/__/src/atom_all.cpp.o
target is built using rule CXX_COMPILER of

lib/libimp_algebra.so (order-only)
lib/libimp_base.so (order-only)
lib/libimp_cgal.so (order-only)
lib/libimp_container.so (order-only)
lib/libimp_core.so (order-only)
lib/libimp_display.so (order-only)
lib/libimp_kernel.so (order-only)
lib/libimp_score_functor.so (order-only)
src/atom_all.cpp
dependent edges build:

lib/libimp_atom.so


Order-only dependencies:
<http://martine.github.io/ninja/manual.html#ref_dependencies>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130617/c87ae823/attachment.htm>


More information about the CMake mailing list