diff --git a/CMakeLists.txt b/CMakeLists.txt index c1a90dac..01bc21b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,13 +91,16 @@ endfunction () # Compiler flags common to both C and CXX # Enable -Wall -# GCC-6 added -Wmisleading-indentation to -Wall, skip these for now set (C_CXX_WARNING_FLAGS -Wall - -Wno-misleading-indentation -Wno-strict-aliasing -Wno-deprecated-declarations # Temp fix for MRAA deprecated methods ) +# GCC-6 added -Wmisleading-indentation to -Wall, skip these for now +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "6") + list (APPEND C_CXX_WARNING_FLAGS -Wno-misleading-indentation) +endif () + # Warnings as errors? if (WERROR) list (APPEND C_CXX_WARNING_FLAGS -Werror)