[cmake-developers] New OBJECT library feature
Brad King
brad.king at kitware.com
Mon Mar 19 14:13:39 EDT 2012
On 3/19/2012 1:56 PM, Eric Noulard wrote:
> That's a great feature.
Thanks.
> Is there a feature that could guarantee the order of appearance of
> those objects / object library on the link line generated for
> add_executable ?
Currently no order is guaranteed other than that all the object files
from directly compiled sources, external objects, and object libraries
will all come before any _linked_ libraries. I'm not sure whether it
is even possible to guarantee an order in all our target build systems.
Can you enumerate use cases when the order of objects matters? Unlike
static libraries *all* objects will be included. If there are duplicate
symbols it is an error. If there are not duplicate symbols then how
does order matter?
> By the way why wouldn't you authorize
> target_link_libraries(exetarget objlibname) ?
As you noted further down in your response I had said it's reserved for
the future. Adding tll() support will require handling of transitive
dependencies and such. I've actually thought through most of the issues
for tll() support but do not want to deal with the implementation yet.
The basic feature was enough work to implement on its own so far.
> I'll test the feature.
Thanks.
FYI, the new "ObjectLibrary" test covers all the supported cases so
you can look there for examples. However, it contains some hacks to
work around minor limitations of some build systems without ruining
the test's coverage on the other systems. There is also a new
"RunCMake.ObjectLibrary" test that covers all the failure case error
messages.
-Brad
More information about the cmake-developers
mailing list