From 09c151a9d29a78cd9feaabad614324167bbe68a9 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Wed, 29 Jul 2020 04:00:54 +0200 Subject: [PATCH] cmake: Don't enable useless warnings on GCC Using '-Wpedantic' on any GCC warnings enables a lot of annoying warnings that don't actually warn about anything. Some of the warnings seem to exist purely for maintaining a certain code style, and have no actual effect on the program itself. Since there is no way to selectively disable warnings like on MSVC, removing it is the easiest choice. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe4bd365..2b3cb2f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,8 +108,8 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-missing-braces -Wmissing-field-initializers -Wno-c++98-compat-pedantic -Wold-style-cast -Wno-documentation -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-switch-enum") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # GCC: -fpermissive is required as GCC does not allow the same template to be in different namespaces. - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wpedantic -fpermissive -Wno-long-long -Wno-missing-braces -Wmissing-field-initializers") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -fpermissive -Wno-long-long -Wno-missing-braces -Wmissing-field-initializers") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fpermissive -Wno-long-long -Wno-missing-braces -Wmissing-field-initializers") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fpermissive -Wno-long-long -Wno-missing-braces -Wmissing-field-initializers") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") # using Intel C++ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")