On Fri, Jul 08, 2016 at 11:40:38 -0400, Brad King wrote:
> This happens because CMake generates order-only dependencies on the
> compilation rules of each exe/lib's objects to make sure the do not
> compile until linking of dependencies is done.  This makes the build
> semantics match that of other generators where each logical target is
> treated as its own isolated build that is evaluated only when its
> logical target dependencies have been finished.
> 
> This is unfortunately necessary to get correct builds for CMake projects
> in general because we support cases where add_custom_command is used
> in library "foo" to generate a header file that is included during
> compilation in library "bar" that links to "foo", but we have no good
> way to express this dependency besides the ordering dependency of bar
> on foo.
> 
> It is likely possible to detect causes automatically when this is
> not necessary, such as when the transitive closure of a target's
> dependencies contains no custom commands.  A dedicated effort will be
> needed to investigate this further and implement such optimizations
> on the build graph generation.

There's an issue for this already:

    https://gitlab.kitware.com/cmake/cmake/issues/15555

I've brainstormed how to detect when the dependencies can be dropped
(it's on some paper around here somewhere...), but haven't implemented
it yet.

--Ben
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to