summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-03-16 19:24:49 +0100
committerSergei Golubchik <serg@mariadb.org>2019-03-27 22:51:37 +0100
commitf97d879bf890fe1d93c459f46410e2be8d26d3b6 (patch)
tree948a0951ebc0b32f9ed4b61aebf7143355a7a815 /cmake
parent1a4746e1285bbe03d616310cd49c3548825d5a1a (diff)
downloadmariadb-git-f97d879bf890fe1d93c459f46410e2be8d26d3b6.tar.gz
cmake: re-enable -Werror in the maintainer mode
now we can afford it. Fix -Werror errors. Note: * old gcc is bad at detecting uninit variables, disable it. * time_t is int or long, cast it for printf's
Diffstat (limited to 'cmake')
-rw-r--r--cmake/maintainer.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
index 4e902d7fed8..caba370c4ae 100644
--- a/cmake/maintainer.cmake
+++ b/cmake/maintainer.cmake
@@ -28,10 +28,15 @@ SET(MY_WARNING_FLAGS
-Woverloaded-virtual
-Wvla
-Wwrite-strings
+ -Werror
)
-IF(MYSQL_MAINTAINER_MODE MATCHES "ON")
- SET(WHERE)
+IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")
+ SET(MY_WARNING_FLAGS ${MY_WARNING_FLAGS} -Wno-error=maybe-uninitialized)
+ENDIF()
+
+IF(MYSQL_MAINTAINER_MODE MATCHES "OFF")
+ RETURN()
ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO")
SET(WHERE DEBUG)
ENDIF()