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

Juan Sanchez Juan.Sanchez at amd.com
Tue Sep 18 13:06:31 EDT 2007


I guess you'd have to come up with a way of renaming each object file
with a prefix special to each original archive.  The "v" option (GNU ar)
will tell you the name object being extracted.  Maybe you can use an
external script to automate the process of renaming the files as they
are being extracted.

Even with Brandon's solution, I don't think ar let you add multiple .o
files of the same name in the archive.  The symbols of the first .o file
will get replaced by the symbols of the second .o file to be added.

Juan

Goswin von Brederlow wrote:
> "Juan Sanchez" <Juan.Sanchez at amd.com> writes:
> 
>> 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.
>>
>> Juan
> 
> I tried that. It fails if two *.o files have the same name as I noticed.
> 
> MfG
>         Goswin
> 
> 


-- 
Juan Sanchez
Juan.Sanchez at amd.com
800-538-8450 Ext. 54395
512-602-4395




More information about the CMake mailing list