[cmake-developers] Recording compiler features for older gcc versions

Rolf Eike Beer eike at sf-mail.de
Mon Jan 9 04:59:13 EST 2017


I need for several projects the ability to set CMAKE_C_STANDARD on older 
compilers, at least gcc 4.2, but preferably also down to gcc 3.4. I have them 
available, so testing is not the issue. But there are some problems besides 
"just record them".

The problems that I know of:

-WriteCompilerDetectionHeader last time had problems when the features for the 
compiler were recorded only for C for a given version, i.e. I can't just tell 
CMake "gcc 3.4ff. know about C99" without also recording C++ features for that 
versions
-the standard check for working features is currently auto_type, which is not 
supported by older compilers. Basically all support long_long_type, so we 
either need to change that (patch is in my gcc-34-features branch), or we need 
a better way to check what is available at all before using it.

Any help welcome.

Eike


More information about the cmake-developers mailing list