On Tue, Jun 26, 2018 at 7:36 PM, Deniz Bahadir <dbaha...@benocs.com> wrote:
Yes, you have overlooked an important detail. Only usage-requirements are transitive, the object-files are only propagated to directly dependent targets (not to indirectly dependent ones) *and only if they have a link/archive step*
Ah, for some reason I had thought object files formed part of the usage requirements of object libraries, but that's clearly not the case.
You need to explicitly add "module1" and "common" to the DLL's target_link_library call to get their object-files, too.
That's unfortunate (for me), but it is what it is I suppose. In my real project I have about 100 modules with dependencies on each other, and I was hoping CMake would take the work out of walking the dependency graph and constructing the final link command. Each module has its immediate dependencies listed, but not further than that. Resolving them all by hand and keeping them up to date isn't really feasible.
Thanks for the explanation! - Jason -- 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: https://cmake.org/mailman/listinfo/cmake