From a1fb10b766bcf05bb8e40bf77fd538c5dbdede97 Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Mon, 23 Nov 2020 10:04:00 -0700 Subject: [PATCH] fix for GCC 9.2: -Wno-maybe-uninitialized --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3264b1accd..ad38cdb18b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -603,6 +603,10 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0) set(EXE_CFLAGS "${EXE_CFLAGS} -Werror=implicit-fallthrough") endif() + # GCC 9.2 and older are unable to detect valid variable initialization in some cases + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 9.2) + set(EXE_CFLAGS "${EXE_CFLAGS} -Wno-maybe-uninitialized") + endif() endif() endif()