diff --git a/CMakeLists.txt b/CMakeLists.txt index af5caaef..c3228dee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,12 +45,6 @@ add_compile_options($<$:-Werror>) add_compile_options($<$:-Wno-error=sequence-point>) add_compile_options($<$:-Wno-error=strict-overflow>) add_compile_options($<$:-Wno-error=logical-not-parentheses>) -if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0) - # this warning was added in gcc 8 https://debarshiray.wordpress.com/2019/04/01/about-wextra-and-wcast-function-type/ - - add_compile_options($<$:-Wno-cast-function-type>) #disable warning - # add_compile_options($<$:-Wno-error=cast-function-type>) #disable errors from warning -endif () # Enable warnings add_compile_options($<$:-Wall>) @@ -59,6 +53,10 @@ add_compile_options($<$:-Wunused-macros>) add_compile_options($<$:-Wno-error=unused-macros>) # Some false positives / only cover current build configuration # Exclude some warnings +if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0) + # this warning was added in gcc 8 https://debarshiray.wordpress.com/2019/04/01/about-wextra-and-wcast-function-type/ + add_compile_options($<$:-Wno-cast-function-type>) +endif () add_compile_options($<$:-Wno-misleading-indentation>) add_compile_options($<$:-Wno-address>) add_compile_options($<$:-Wno-unused-parameter>)