[CMake] faq update?

Juan Sanchez Juan.Sanchez at amd.com
Thu Sep 13 15:12:28 EDT 2007


Hello Brandon,

This is the way they are choosing to do this in our organization.  We
only build for gcc on Linux.  If we built for multiple platforms, we
could have platform specific conditional statements, as in the
hyperlinked example I have provided.

In deference to elegance, the project will now compile in half the time.

The statement in the FAQ is untrue:

>> That means I have to build all my library objects twice, once for shared
>> and once for static. I don't like that!

This statement may also be a dealbreaker for those maintaining huge
projects.

If we choose to use the exact same flags, why shouldn't we be able to
choose to create the shared library from the archive?

If you have something in the FAQ, shouldn't it provide the option for
people who are concerned with the inefficiency of compiling object files
twice?

It is not a hack.  It is the way ld works on linux, and I think that it
is a valid approach.  I'd prefer not to engage in wiki wars where I
replace the untrue statement, with a technically correct "hack".  Then
someone goes and changes it back.

Juan

Brandon Van Every wrote:
> On 9/13/07, Juan Sanchez <Juan.Sanchez at amd.com> wrote:
>> The FAQ doesn't mention the trick for loading a shared library from a
>> static one.  They therefore think their objects have to be compiled
>> twice, even when they are using -fPIC on gcc and want the same compiler
>> flags.
>>
>> http://www.mail-archive.com/cmake@cmake.org/msg01890.html
> 
> This looks like a horrible GCC specific hack.  Why should such a thing
> be in the FAQ?  I would think the FAQ should contain advice that's
> good CMake practice and works cross-platform with all the compilers.
> Let's distinguish between "Frequently" Asked Questions and general
> repositories of tips and tricks tricks.  There are other sections of
> the wiki where you could put a GCC-specific trick.
> 
>> Could this be updated?
> 
> http://www.cmake.org/Wiki/CMake_FAQ is a wiki so yes you could
> personally update it.  But I think others should weigh in about
> whether or not you should.
> 
>> This FAQ entry is scaring some of my colleagues:
>>
>> That means I have to build all my library objects twice, once for shared
>> and once for static. I don't like that!
>>
>> and they are on the prowl for cmake dealbreakers.
> 
> Well they're actually going to do cross-platform work with compilers
> other than GCC, they can't rely on GCC behavior to solve all their
> problems.  So dealbreak away.  Politically, do they know they actually
> need MSVC support?  Or are they in the "gee we're Unix, why CMake?"
> stage.  There's nothing you can do about the latter unless you have a
> pressing need or desire for cross-platform support.
> 
> 
> Cheers,
> Brandon Van Every




More information about the CMake mailing list