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"`.
This commit is contained in:
@@ -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!")
|
||||
|
Reference in New Issue
Block a user