[CMake] Creating a static lib from other static libs, HOW?

Juan Sanchez Juan.Sanchez at amd.com
Tue Sep 18 15:34:38 EDT 2007


If you want to add object files individually to the archive, you need to
be very careful that ar is serialized on unix systems.  So be careful
doing a parallel build.

http://www.gnu.org/software/make/manual/make.html#Archive-Pitfalls

Regards,

Juan

Goswin von Brederlow wrote:
> "Brandon Van Every" <bvanevery at gmail.com> writes:
> 
>> On 9/16/07, Juan Sanchez <Juan.Sanchez at amd.com> wrote:
>>> Hello,
>>>
>>> The ar command can be used to extract the .o files from a .a file.
>>> Extracting them all into the same directory, perhaps you can use some
>>> file globbing to find all the objects and add them to another archive.
>> Yeah but that's the ar command, which is specific to Unixy systems.
>> Doesn't help a cross-platform build solution that includes MSVC.
>>
>> I just got done telling all you guys how to reuse objects in a
>> platform independent manner.  And it's in the FAQ now for handy
>> reference.
> 
> Problems arise when you have too many objects for the command line.
> You need succesive links steps then. Did you consider that?
> 
> MfG
>         Goswin





More information about the CMake mailing list