diff options
author | Vladislav Vaintroub <wlad@sun.com> | 2010-06-21 13:39:30 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@sun.com> | 2010-06-21 13:39:30 +0200 |
commit | 97d36ef532d4f0e9cd64eeb314167ff45a00ac6d (patch) | |
tree | 58ae60fc53279f63640fbfdbe29ce6e6b60ab3c8 | |
parent | e475440f1b2e8cee42b8594b4f957c0cc96bb118 (diff) | |
download | mariadb-git-97d36ef532d4f0e9cd64eeb314167ff45a00ac6d.tar.gz |
Bug#53593: Add some instrumentation to improve Valgrind sensitivity.
Implement WITH_VALGRIND for the CMake build.
-rwxr-xr-x | CMakeLists.txt | 3 | ||||
-rw-r--r-- | config.h.cmake | 2 | ||||
-rw-r--r-- | configure.cmake | 10 |
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 #-------------------------------------------------------------------- |