[CMake] merge static libraries with ar
Brandon Van Every
bvanevery at gmail.com
Sat Jul 28 21:46:49 EDT 2007
On 7/28/07, Timur Ivanov <timur.ivanov at gmail.com> wrote:
> On 7/28/07, Brandon Van Every <bvanevery at gmail.com> wrote:
> > This
> > requires special knowledge of where CMake has put the object files,
> > there's no standard interface for it. Chicken does all of this [...]
> > See the Chicken build for details.
> > http://www.call-with-current-continuation.org/
> >
>
> So the only way is to extract all .o files from foo bar baz libraries
> (ar x ...) and create libcool.a from them by some MACRO ?
No, you build the libraries libfoo.a, libbar.a, libbaz.a, then obtain
a list of the objects that went into building them, then you dump the
objects directly into a new libcool.a. You never run any AR unpacking
operation. That would be a tool-specific approach; there's no
guarantee that your OS actually uses AR. Whereas building the static
libraries, then reusing the objects directly, will work on any
platform no matter the linker toolchain.
> Is there
> any way in cmake to get full path to that foo, bar, baz libraries ?
See how Chicken does it.
Cheers,
Brandon Van Every
More information about the CMake
mailing list