summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2022-01-03 19:17:02 +0000
committerSadie Powell <sadie@witchery.services>2022-01-04 00:39:05 +0000
commiteb81f22a5b1df18c9844893c55f57762148f2bd0 (patch)
treefb178d90cac536562faeabd2a57f720d70cc0530 /CMakeLists.txt
parenta31a7f5a6ce3f47716a9313d232c2a40955fd1e1 (diff)
Modernize CXXFLAGS on Unix and enable -Werror on CI.
Also clear up warnings that this exposed.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 4 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2d02f3ea6..c2133e73b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -188,19 +188,10 @@ if(MSVC)
# Otherwise, we're not using Visual Studio
else()
# Set the compile flags to have all warnings on (including shadowed variables)
- set(CXXFLAGS "${CXXFLAGS} -Wall -Wshadow")
- # If on a *nix system, also set the compile flags to remove GNU extensions (favor ISO C++) as well as reject non-ISO C++ code, also remove all leading underscores in exported symbols (only on GNU compiler)
- if(UNIX)
- set(CXXFLAGS "${CXXFLAGS} -pedantic ${CMAKE_CXX_FLAGS}")
- if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- set(CXXFLAGS "${CXXFLAGS} -fno-leading-underscore")
- endif()
- # If we aren't on a *nix system, we are using MinGW
- else()
- # Also, if we are building under MinGW, add another define for MinGW
- if(MINGW)
- add_definitions(-DMINGW)
- endif()
+ set(CXXFLAGS "${CXXFLAGS} -Wall -Wextra -Wpedantic -Wno-unused-parameter ${CMAKE_CXX_FLAGS}")
+ # Also, if we are building under MinGW, add another define for MinGW
+ if(MINGW)
+ add_definitions(-DMINGW)
endif()
endif()