summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2010-11-05 14:33:59 +0100
committerGuilhem Bichot <guilhem@mysql.com>2010-11-05 14:33:59 +0100
commit6bf5b4b98cbe53239ff766325653947f854e26d5 (patch)
tree2305a8d4c39abc36144e6d177c24a660ebeea6c5 /CMakeLists.txt
parentf80d13e5303c80e149d82701d97bb5f57a18c4f2 (diff)
parentfb2b0a48bcd381703f9a10025c832817a6ea7630 (diff)
downloadmariadb-git-6bf5b4b98cbe53239ff766325653947f854e26d5.tar.gz
Merge of the fix for BUG#57933 "add -Wdeclaration-after-statement to gcc builds"
from 5.1; extended here to Cmake builds.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c349813f68..544c48f79f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,18 +115,27 @@ ENDIF()
# Control aspects of the development environment which are
# specific to MySQL maintainers and developers.
#
+INCLUDE (CheckCCompilerFlag)
OPTION(MYSQL_MAINTAINER_MODE "MySQL maintainer-specific development environment" OFF)
# Whether the maintainer mode should be enabled.
IF(MYSQL_MAINTAINER_MODE)
IF(CMAKE_COMPILER_IS_GNUCC)
+ CHECK_C_COMPILER_FLAG("-Wdeclaration-after-statement" HAVE_DECLARATION_AFTER_STATEMENT)
+ IF(HAVE_DECLARATION_AFTER_STATEMENT)
+ SET(MY_MAINTAINER_DECLARATION_AFTER_STATEMENT "-Wdeclaration-after-statement")
+ ENDIF()
SET(MY_MAINTAINER_C_WARNINGS
- "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror"
- CACHE STRING "C warning options used in maintainer builds.")
+ "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(MY_MAINTAINER_CXX_WARNINGS "${MY_MAINTAINER_C_WARNINGS} -Wno-unused-parameter"
CACHE STRING "C++ warning options used in maintainer builds.")
ENDIF()
+ IF(CMAKE_COMPILER_IS_GNUCC)
+ SET(MY_MAINTAINER_C_WARNINGS
+ "${MY_MAINTAINER_C_WARNINGS} ${MY_MAINTAINER_DECLARATION_AFTER_STATEMENT}"
+ CACHE STRING "C warning options used in maintainer builds.")
+ ENDIF()
# Do not make warnings in checks into errors.
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wno-error")