Skip to content

Commit

Permalink
Enable additional warnings with GCC/Clang to match Visual Studio
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Feb 7, 2025
1 parent 85155f1 commit 0ca98d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Enable lots of warnings
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Werror -Wswitch-enum \
-Wextra -Wconversion \
-Wno-deprecated-declarations -Wno-maybe-uninitialized")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
Expand All @@ -86,7 +87,9 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
# Enable lots of warnings
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Werror -Wswitch-enum -Wno-deprecated-declarations")
"${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Werror -Wswitch-enum \
-Wextra -Wconversion \
-Wno-deprecated-declarations")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# This would be the place to enable warnings for Windows builds, although
# config.inc doesn't seem to do that currently
Expand Down
2 changes: 1 addition & 1 deletion src/config.inc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ifeq ($(BUILD_ENV),MSVC)
CXXFLAGS += /wd4619
else
CXXFLAGS += -Wall -pedantic -Werror -Wswitch-enum
CXXFLAGS += -Wno-deprecated-declarations
CXXFLAGS += -Wno-deprecated-declarations -Wextra -Wconversion
# GCC only, silence clang warning
CXXFLAGS += -Wno-maybe-uninitialized -Wno-unknown-warning-option
endif
Expand Down

0 comments on commit 0ca98d2

Please sign in to comment.