diff options
author | Davi Arnaut <davi.arnaut@oracle.com> | 2010-12-15 08:30:09 -0200 |
---|---|---|
committer | Davi Arnaut <davi.arnaut@oracle.com> | 2010-12-15 08:30:09 -0200 |
commit | 995ce0bb0aaaa52116d3a2532a32d91f0d416232 (patch) | |
tree | 621d527fa446381d3c794ad33ac9c9c18954234f /CMakeLists.txt | |
parent | 40d32fc8c142745c636642f5e48011afa023aa48 (diff) | |
download | mariadb-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.txt | 34 |
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() |