summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-12-15 08:30:09 -0200
committerDavi Arnaut <davi.arnaut@oracle.com>2010-12-15 08:30:09 -0200
commit995ce0bb0aaaa52116d3a2532a32d91f0d416232 (patch)
tree621d527fa446381d3c794ad33ac9c9c18954234f /CMakeLists.txt
parent40d32fc8c142745c636642f5e48011afa023aa48 (diff)
downloadmariadb-git-995ce0bb0aaaa52116d3a2532a32d91f0d416232.tar.gz
Bug#58871: Reorganize maintainer mode compiler flags to allow
option for specific compilers Reorganize the maintainer mode cmake code to allow options for specific compilers. For now, enable -Wcheck for ICC, but do not turn warnings into errors.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt34
1 files changed, 14 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07809a8e29b..059d68e0a3c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,30 +115,24 @@ 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.
+INCLUDE(maintainer)
+
+OPTION(MYSQL_MAINTAINER_MODE
+ "MySQL maintainer-specific development environment" OFF)
+
+# Whether the maintainer mode compiler options 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")
+ IF(CMAKE_C_COMPILER_ID MATCHES "GNU")
+ SET_MYSQL_MAINTAINER_GNU_C_OPTIONS()
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.")
+ IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS()
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.")
+ IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
+ SET_MYSQL_MAINTAINER_INTEL_C_OPTIONS()
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")
+ IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ SET_MYSQL_MAINTAINER_INTEL_CXX_OPTIONS()
ENDIF()
ENDIF()