[CMake] target_link_libraries build order dependencies

Christian Rorvik christian.rorvik at gmail.com
Fri Jul 27 04:36:17 EDT 2012


Hi all,

In CMake target_link_libraries adds both transitive link dependencies and
build order dependencies. For static libraries this isn't always necessary
and in many cases produces an overly conservative build ordering and
restricts parallelism. I haven't found a way to work around this in CMake,
so what I've ended up doing is patching the CMake source to not add these
dependencies for static libraries and only track dependencies up to the
final link target (a few small changes in cmComputeTargetDepends.*). Is
this something maintainers would be willing to consider for CMake mainline?
Backwards compatibility must be preserved of course, but I could imagine a
few different ways of selecting the desired behavior (globally via
variables, by policy, by parameter to the command, by a new command, etc).
I'm not sure which would be most convenient.

Regards,
Christian Rorvik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120727/58241248/attachment.htm>


More information about the CMake mailing list