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.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-07-29 04:00:54 +02:00 committed by Michael Fabian Dirks
parent d332007ae0
commit 2a4f771d85

View file

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