@@ -987,6 +987,9 @@ else () # NOT MSVC
987987 message (STATUS "Compiler type GNU: ${CMAKE_CXX_COMPILER} " )
988988 set (BASE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-deprecated-declarations ${BASE_FLAGS} " )
989989 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 ()
990993 elseif (CMAKE_COMPILER_IS_CLANG)
991994 message (STATUS "Compiler type CLANG: ${CMAKE_CXX_COMPILER} " )
992995 set (BASE_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-deprecated-declarations ${BASE_FLAGS} " )
@@ -1033,7 +1036,7 @@ else () # NOT MSVC
10331036 # CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}.
10341037 # there is no need to repeat the base flags in the build-type specific flags!
10351038 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" )
10371040 set (CMAKE_C_FLAGS_MINSIZEREL "${NODEBUGINFO_FLAGS} -Os" CACHE INTERNAL "C minimal size flags" )
10381041 set (CMAKE_C_FLAGS_RELEASE "${NODEBUGINFO_FLAGS} -O3 -fomit-frame-pointer" CACHE INTERNAL "C release flags" )
10391042 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
10441047 # CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}.
10451048 # there is no need to repeat the base flags in the build-type specific flags!
10461049 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" )
10481051 set (CMAKE_CXX_FLAGS_MINSIZEREL "${NODEBUGINFO_FLAGS} -Os" CACHE INTERNAL "C++ minimal size flags" )
10491052 set (CMAKE_CXX_FLAGS_RELEASE "${NODEBUGINFO_FLAGS} -O3 -fomit-frame-pointer" CACHE INTERNAL "C++ release flags" )
10501053 set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${DEBUGINFO_FLAGS} -O3 -fno-omit-frame-pointer" CACHE INTERNAL "C++ release with debug info flags" )
0 commit comments