[cmake-developers] compute-default-dialect topic

Brad King brad.king at kitware.com
Wed Sep 16 13:27:20 EDT 2015


Steve,

In regard to this topic:

 Project: Determine default language dialect for the compiler.
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77691638

 fixup! Project: Determine default language dialect for the compiler.
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=10e937ad

 fixup! Project: Determine default language dialect for the compiler.
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ba7ade5f

The default dialect computed with the compiler id may not be the
same as the effective default dialect when CMAKE_CXX_FLAGS is
considered.  One may build with -std=c++11, for example, thus
making the dialect used for compilation different than the raw
compiler default even when CMake does not add a -std= flag.

This is done for CMake itself on some dashboard builds:

 https://open.cdash.org/viewNotes.php?buildid=4011828
 set(RR_FLAGS_C "${RR_FLAGS_COMMON} -std=c11")
 set(RR_FLAGS_CXX "${RR_FLAGS_COMMON} -std=c++11 -stdlib=libc++")
 set(ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}")
 set(ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}")
 ...
 CMake_NO_C_STANDARD:BOOL=1
 CMake_NO_CXX_STANDARD:BOOL=1

These builds are where the RunCMake.CompileFeatures test failed
with this topic.

-Brad


More information about the cmake-developers mailing list