summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCMakeLists.txt3
-rw-r--r--config.h.cmake2
-rw-r--r--configure.cmake10
3 files changed, 13 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 536fae9f4b1..f4c7f552e93 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,6 +115,9 @@ OPTION(ENABLED_PROFILING "Enable profiling" ON)
OPTION(CYBOZU "" OFF)
OPTION(BACKUP_TEST "" OFF)
OPTION(WITHOUT_SERVER OFF)
+IF(UNIX)
+ OPTION(WITH_VALGRIND "Valgrind instrumentation" OFF)
+ENDIF()
OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)
MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED)
diff --git a/config.h.cmake b/config.h.cmake
index c6c049814ba..3fa15a0706a 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -292,7 +292,7 @@
#define USE_MB 1
#define USE_MB_IDENT 1
-
+#cmakedefine HAVE_VALGRIND
/* Types we may use */
#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@
diff --git a/configure.cmake b/configure.cmake
index 1727e2b2c10..246133f1fbe 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -777,7 +777,7 @@ ENDIF(NOT HAVE_POSIX_SIGNALS)
# Assume regular sprintf
SET(SPRINTFS_RETURNS_INT 1)
-IF(CMAKE_COMPILER_IS_GNUXX)
+IF(CMAKE_COMPILER_IS_GNUCXX)
CHECK_CXX_SOURCE_COMPILES("
#include <cxxabi.h>
int main(int argc, char **argv)
@@ -969,6 +969,14 @@ configuration. By default gcc built-in sync functions are used,
if available and 'smp' configuration otherwise.")
MARK_AS_ADVANCED(WITH_ATOMIC_LOCKS MY_ATOMIC_MODE_RWLOCK MY_ATOMIC_MODE_DUMMY)
+IF(WITH_VALGRIND)
+ CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h"
+ HAVE_VALGRIND_HEADERS)
+ IF(HAVE_VALGRIND_HEADERS)
+ SET(HAVE_VALGRIND 1)
+ ENDIF()
+ENDIF()
+
#--------------------------------------------------------------------
# Check for IPv6 support
#--------------------------------------------------------------------