From 9c9ac0d5890e550eb84ce47319138d2f5350a6bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Thu, 26 Jan 2017 18:16:41 +0100 Subject: [PATCH] Change `-std=gnu++11` to `-std=c++11` I propose changing the default `-std=` compiler flag from the non- standard `gnu++11` to `c++11`. Our code is fully C++11 compliant and that should be reflected in the C++ standard we choose as default. Furthermore there's an ambiguity as we make people use `-DCMAKE_CXX_FLAGS="-std=c++11"` when this is already handled (differently) in `CMakeLists.txt`. See the [pixls.us](https://discuss.pixls.us/t/rawtherapee-5-and-dcmake-cxx-flags/3145/3) discussion. You also see it in `AboutThisBuild.txt`: ``` Build flags: -std=c++11 -Wno-deprecated-declarations -Wno-unused-result -std=gnu++11 -march=native -Werror=unused-label -fopenmp -Werror=unknown-pragmas -O3 -DNDEBUG ``` This commit changes `-std=gnu++11` to `-std=c++11` and builds fine without `-DCMAKE_CXX_FLAGS="-std=c++11"`. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2fb88ec9..22c71c269 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,8 +21,8 @@ endif () string (TOUPPER ${CMAKE_BUILD_TYPE} UPPER_CMAKE_BUILD_TYPE) # Set required C and C++ standards and check GCC version -SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") -SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") +SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11") +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9") message(FATAL_ERROR "Building RawTherapee requires using GCC version 4.9 or higher!")