[CMake] Merge two static libraries
Marcel Loose
loose at astron.nl
Tue Oct 5 07:51:00 EDT 2010
On Tue, 2010-10-05 at 13:40 +0200, Hendrik Sattler wrote:
> Zitat von "Marcel Loose" <loose at astron.nl>:
> > Even if you opt for the "one static library" option, you already
gain in
> > build speed. Suppose you've modified foo.c, then CMake will only
rebuild
> > foo.o. Of course, it will rebuild foo.o twice, once for libconsole,
once
> > for libwindows. But that's already much better than recompiling all
50
> > sources twice.
>
> Such requests come up regularly. The solution would be easy: something
> like VIRTUAL as alternative to the STATIC flags of add_library().
> Cmake could just omit the link step (it already knows all object
> files) and linking such a virtual library to a static one just
> includes the already compiled object files. That would exactly achieve
> the requested features (compiling those files only once), is hack-free
> and totally straight-forward.
>
> Just not done...
>
> HS
>
Well, maybe it's worth to enter it as an enhancement request in the
issue tracker.
Regards,
Marcel Loose.
More information about the CMake
mailing list