summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt34
-rw-r--r--cmake/configure.pl6
-rw-r--r--storage/innobase/CMakeLists.txt2
3 files changed, 41 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0131ac1b0a7..bc9adafcf63 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,6 +104,27 @@ IF(DEFINED ENV{CPPFLAGS})
ADD_DEFINITIONS($ENV{CPPFLAGS})
ENDIF()
+#
+# Control aspects of the development environment which are
+# specific to MySQL maintainers and developers.
+#
+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)
+ SET(MY_MAINTAINER_C_WARNINGS "-Wall -Wextra -Wunused -Wwrite-strings -Werror"
+ CACHE STRING "C warning options used in maintainer builds.")
+ 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()
+ # 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")
+ ENDIF()
+ENDIF()
+
# Add macros
INCLUDE(character_sets)
INCLUDE(zlib)
@@ -227,6 +248,19 @@ MYSQL_CHECK_SSL()
# Add readline or libedit.
MYSQL_CHECK_READLINE()
+#
+# Setup maintainer mode options by the end. Platform checks are
+# not run with the warning options as to not perturb fragile checks
+# (i.e. do not make warnings into errors).
+#
+IF(MYSQL_MAINTAINER_MODE)
+ # Set compiler flags required under maintainer mode.
+ MESSAGE(STATUS "C warning options: ${MY_MAINTAINER_C_WARNINGS}")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_MAINTAINER_C_WARNINGS}")
+ MESSAGE(STATUS "C++ warning options: ${MY_MAINTAINER_CXX_WARNINGS}")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_MAINTAINER_CXX_WARNINGS}")
+ENDIF()
+
IF(NOT WITHOUT_SERVER)
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
# Add storage engines and plugins.
diff --git a/cmake/configure.pl b/cmake/configure.pl
index fba417365fc..5be47ce5a31 100644
--- a/cmake/configure.pl
+++ b/cmake/configure.pl
@@ -184,6 +184,12 @@ foreach my $option (@ARGV)
$cmakeargs = $cmakeargs." -DWITH_DEBUG_FULL=1";
next;
}
+ if ($option =~ /mysql-maintainer-mode/)
+ {
+ $cmakeargs = $cmakeargs." -DMYSQL_MAINTAINER_MODE=" .
+ ($option =~ /enable/ ? "1" : "0");
+ next;
+ }
$option = uc($option);
$option =~ s/-/_/g;
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 90246aaa99d..b6399dcc478 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -95,7 +95,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
#include <pthread.h>
#include <string.h>
- int main(int argc, char** argv) {
+ int main() {
pthread_t x1;
pthread_t x2;
pthread_t x3;