Skip to content

C++ version check can create broken configurations

The C++ version check in CheckCXXFeatures.cmake supports a variable DISABLE_CXX_VERSION_CHECK that turns off all attempts to switch the compiler into a specific C++ standard mode. That doesn't really work for the current master anymore because we now require at least C++11. Would it perhaps be more useful to instead have something like LIMIT_CXX_VERSION_CHECK that can be set to something like 11 or 14 (or in the future 17)? Right now, in order to have my compiler use C++11 instead of C++14, I have to define DISABLE_CXX_VERSION_CHECK and stick -std=c++11 into my CMAKE_CXX_FLAGS, which isn't very intuitive...

In any case, the test should always make sure that we are running at least in C++11 mode and bail out if we don't (maybe by checking the value of the __cplusplus macro, which is set to a sane value by all current compilers - GCC does so since at least 4.8).