cmake: check compiler version before adding -Wno-misleading-indentation flag

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Mihai Tudor Panu 2019-04-10 22:59:49 +00:00
parent d256a225bf
commit d282d479bb

View File

@ -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)