[CMake] Creating a static lib from other static libs, HOW?
Goswin von Brederlow
brederlo at informatik.uni-tuebingen.de
Sat Sep 22 22:48:39 EDT 2007
"Brandon Van Every" <bvanevery at gmail.com> writes:
> On 9/18/07, Goswin von Brederlow <brederlo at informatik.uni-tuebingen.de> wrote:
>> "Brandon Van Every" <bvanevery at gmail.com> writes:
>> >
>> > 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?
>
> If CMake considered it. All I do is find the objects that CMake
> already generated, then dump them directly into a library target.
> CMake can swallow all kinds of stuff, *.c files, *.h files, *.o files,
> whatever.
>
> This is part of why I think you guys should stop messing around with
> non-CMake ways of doing things. It either works and hey presto!
Or it just goes horribly wrong in some hidden corner with totaly
unpredictable effect and race conditions. That is why before
introducing a concept like yours you have to think out what it all
means.
CMake will have to use AR to create the archive and it has to limit
the command line. If it does multiple ar calls to add more and more
objects it can easily overwrite exitsing entries if the wrong options
are used. Also commandline overflow is much more likely with long
pathnames. Maybe just nobody cared about it yet since it never happens
for normal dirs. Also with a single dir name collisions won't happen
while with multiple dirs they might.
Doing it the CMake way just means that you have to have thought about
these things in CMAKE. That is what we are doing I believe. Sorry if
we go into the gory details of ar for this.
MfG
Goswin
More information about the CMake
mailing list