[cmake-developers] [PATCH] Features: Only enable C11 support on GCC >= 4.9.

Brad King brad.king at kitware.com
Mon Sep 14 14:38:16 EDT 2015


On 09/14/2015 02:29 PM, Raphael Kubo da Costa wrote:
> Do you mean checking for FreeBSD and compiler version? I thought it'd be
> too specific for upstream and was just going to make it be built with a
> different standard (or no standard) on FreeBSD itself.

I meant to add a try_compile check with

  CMAKE_FLAGS -DCMAKE_C_STANDARD=11

using a source file that exercises the problematic code in question.
See similar checks here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/Checks/cm_cxx14_cstdio.cmake;hb=v3.3.1
 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/Checks/cm_cxx11_unordered_map.cmake;hb=v3.3.1

that check if using certain CMAKE_CXX_STANDARD values works for some
cases CMake hits with broken C++11 and C++14 platform/compiler combos.

This will help CMake build out of the box on FreeBSD with GCC 4.7
without manually adding -DCMake_NO_C_STANDARD=TRUE.

-Brad



More information about the cmake-developers mailing list