[CMake] Enabling C99 in CMake
Sean McBride
sean at rogue-research.com
Thu Jun 23 12:29:01 EDT 2011
On Thu, 23 Jun 2011 18:20:46 +0200, Jed Brown said:
>> You need to use a C99 compiler for your project
>
>
>This is already a problem. C99 introduces new keywords (e.g. restrict) and
>removes implicit int. It is entirely possible for part of a project to
>include C89-conforming legacy code that is not valid C99. The use of C99 or
>C89 should be a file- and directory-level property.
>
>It's also horrible to encumber the poor user just trying to build your
>project with needing to know whether it is written in C99 or whatever else,
>nor with how to make their compiler deliver that dialect.
>
>CMake does not ask the user to provide the full command to link a shared
>library, it should not require the user to specify dialect C99/C89.
I agree. And of course this problem is not limited to C, there are several not-fully-compatible versions of C++ too. gcc accepts flags like -std=c++98 and -std=c++0x to choose between them. Different compilers presumably need different flags.
--
____________________________________________________________
Sean McBride, B. Eng sean at rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
More information about the CMake
mailing list