@@ -987,6 +987,9 @@ else () # NOT MSVC
987
987
message (STATUS "Compiler type GNU: ${CMAKE_CXX_COMPILER} " )
988
988
set (BASE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-deprecated-declarations ${BASE_FLAGS} " )
989
989
set (EXTRA_CXX_FLAGS "-Wsuggest-override -Wnon-virtual-dtor" )
990
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "11.1.0" )
991
+ set (EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-error=nonnull" )
992
+ endif ()
990
993
elseif (CMAKE_COMPILER_IS_CLANG )
991
994
message (STATUS "Compiler type CLANG: ${CMAKE_CXX_COMPILER} " )
992
995
set (BASE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-deprecated-declarations ${BASE_FLAGS} " )
@@ -1033,7 +1036,7 @@ else () # NOT MSVC
1033
1036
# CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}.
1034
1037
# there is no need to repeat the base flags in the build-type specific flags!
1035
1038
set (CMAKE_C_FLAGS "${EXTRA_C_FLAGS} " CACHE INTERNAL "default C compiler flags" )
1036
- set (CMAKE_C_FLAGS_DEBUG "${DEBUGINFO_FLAGS} -O0 -D_DEBUG=1" CACHE INTERNAL "C debug flags" )
1039
+ set (CMAKE_C_FLAGS_DEBUG "${DEBUGINFO_FLAGS} -Og -D_DEBUG=1" CACHE INTERNAL "C debug flags" )
1037
1040
set (CMAKE_C_FLAGS_MINSIZEREL "${NODEBUGINFO_FLAGS} -Os" CACHE INTERNAL "C minimal size flags" )
1038
1041
set (CMAKE_C_FLAGS_RELEASE "${NODEBUGINFO_FLAGS} -O3 -fomit-frame-pointer" CACHE INTERNAL "C release flags" )
1039
1042
set (CMAKE_C_FLAGS_RELWITHDEBINFO "${DEBUGINFO_FLAGS} -O3 -fno-omit-frame-pointer" CACHE INTERNAL "C release with debug info flags" )
@@ -1044,7 +1047,7 @@ else () # NOT MSVC
1044
1047
# CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}.
1045
1048
# there is no need to repeat the base flags in the build-type specific flags!
1046
1049
set (CMAKE_CXX_FLAGS "${EXTRA_CXX_FLAGS} " CACHE INTERNAL "default C++ compiler flags" )
1047
- set (CMAKE_CXX_FLAGS_DEBUG "${DEBUGINFO_FLAGS} -O0 -D_DEBUG=1" CACHE INTERNAL "C++ debug flags" )
1050
+ set (CMAKE_CXX_FLAGS_DEBUG "${DEBUGINFO_FLAGS} -Og -D_DEBUG=1" CACHE INTERNAL "C++ debug flags" )
1048
1051
set (CMAKE_CXX_FLAGS_MINSIZEREL "${NODEBUGINFO_FLAGS} -Os" CACHE INTERNAL "C++ minimal size flags" )
1049
1052
set (CMAKE_CXX_FLAGS_RELEASE "${NODEBUGINFO_FLAGS} -O3 -fomit-frame-pointer" CACHE INTERNAL "C++ release flags" )
1050
1053
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${DEBUGINFO_FLAGS} -O3 -fno-omit-frame-pointer" CACHE INTERNAL "C++ release with debug info flags" )
0 commit comments