aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorReinUsesLisp <[email protected]>2019-11-27 05:25:27 -0300
committerReinUsesLisp <[email protected]>2019-11-27 05:25:35 -0300
commit22cc6f6c1bec6ea050069dc618555bc089c66357 (patch)
tree47528741d335db912a71195d72016c97d832aa44 /CMakeLists.txt
parent71b53b855a2a5427c8e1e91559b3d39c21f7437d (diff)
downloadsirit-22cc6f6c1bec6ea050069dc618555bc089c66357.tar.gz
sirit-22cc6f6c1bec6ea050069dc618555bc089c66357.zip
cmake: Always treat warnings as errors
Enable cast warnings in gcc and clang and always treat warnings as errors. GetWordCount now returns std::size_t for simplicity and the word count is asserted and casted in WordCount (now called CalculateTotalWords. Silence warnings.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 6 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b77c1b..a7935d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,12 +54,8 @@ if (MSVC)
/EHsc
/Zc:throwingNew # Assumes new never returns null
/Zc:inline # Omits inline functions from object-file output
- /DNOMINMAX)
-
- if (SIRIT_WARNINGS_AS_ERRORS)
- list(APPEND SIRIT_CXX_FLAGS
- /WX)
- endif()
+ /DNOMINMAX
+ /WX)
if (CMAKE_VS_PLATFORM_TOOLSET MATCHES "LLVM-vs[0-9]+")
list(APPEND SIRIT_CXX_FLAGS
@@ -74,12 +70,10 @@ else()
-pedantic
-pedantic-errors
-Wfatal-errors
- -Wno-missing-braces)
-
- if (SIRIT_WARNINGS_AS_ERRORS)
- list(APPEND SIRIT_CXX_FLAGS
- -Werror)
- endif()
+ -Wno-missing-braces
+ -Wconversion
+ -Wsign-conversion
+ -Werror)
endif()
# Enable unit-testing.