From 1558ca2bb5e6ae00149d633217eb5404129b308b Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Wed, 3 Apr 2019 15:21:11 +0200 Subject: [PATCH] version check of compiler --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a947fc38..e66855e53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,6 @@ target_compile_options(slsProjectWarnings INTERFACE -Wall -Wnon-virtual-dtor -Woverloaded-virtual - -Wnull-dereference -Wdouble-promotion -Wformat=2 ) @@ -73,8 +72,13 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") target_compile_options(slsProjectWarnings INTERFACE -Wno-misleading-indentation # mostly in rapidjson remove using clang format -Wno-class-memaccess # also in rapidjson - -Wduplicated-cond ) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) + target_compile_options(slsProjectWarnings INTERFACE + -Wduplicated-cond + -Wnull-dereference ) + + endif() endif()