From: Matthias Maier Date: Fri, 5 Jul 2024 19:31:39 +0000 (-0500) Subject: CMake: Bugfix: only set up valgrind wrapper when needed X-Git-Tag: v9.6.0-rc1~130^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17215%2Fhead;p=dealii.git CMake: Bugfix: only set up valgrind wrapper when needed --- diff --git a/tests/performance/CMakeLists.txt b/tests/performance/CMakeLists.txt index 2583a5e10a..f153e019ed 100644 --- a/tests/performance/CMakeLists.txt +++ b/tests/performance/CMakeLists.txt @@ -6,32 +6,36 @@ project(testsuite CXX) # Try to locate valgrind: # -find_program(VALGRIND_EXECUTABLE - NAMES valgrind - HINTS ${VALGRIND_DIR} - PATH_SUFFIXES bin - ) - -find_path(VALGRIND_INCLUDE_DIR valgrind/callgrind.h - HINTS ${VALGRIND_DIR} - PATH_SUFFIXES include - ) - -if( NOT VALGRIND_EXECUTABLE MATCHES "-NOTFOUND" AND - NOT VALGRIND_INCLUDE_DIR MATCHES "-NOTFOUND" ) - message(STATUS "Found valgrind at ${VALGRIND_EXECUTABLE}") - set(DEAL_II_WITH_VALGRIND TRUE) - set(_command_line - "${VALGRIND_EXECUTABLE}" - --tool=callgrind -q --combine-dumps=yes --instr-atstart=no - --callgrind-out-file=callgrind.out +if(ENABLE_PERFORMANCE_TESTS) + find_program(VALGRIND_EXECUTABLE + NAMES valgrind + HINTS ${VALGRIND_DIR} + PATH_SUFFIXES bin ) -else() - message(STATUS "Could not find valgrind") - set(DEAL_II_WITH_VALGRIND FALSE) -endif() -set(performance_instrumentation_step_3_RUNARGS_PREFIX "${_command_line}") -set(performance_instrumentation_step_22_RUNARGS_PREFIX "${_command_line}") + find_path(VALGRIND_INCLUDE_DIR valgrind/callgrind.h + HINTS ${VALGRIND_DIR} + PATH_SUFFIXES include + ) + + if( NOT VALGRIND_EXECUTABLE MATCHES "-NOTFOUND" AND + NOT VALGRIND_INCLUDE_DIR MATCHES "-NOTFOUND" ) + message(STATUS "Found valgrind at ${VALGRIND_EXECUTABLE}") + set(DEAL_II_WITH_VALGRIND TRUE) + + set(_command_line + "${VALGRIND_EXECUTABLE}" + --tool=callgrind -q --combine-dumps=yes --instr-atstart=no + --callgrind-out-file=callgrind.out + ) + set(performance_instrumentation_step_3_RUNARGS_PREFIX "${_command_line}") + set(performance_instrumentation_step_22_RUNARGS_PREFIX "${_command_line}") + + else() + + message(STATUS "Could not find valgrind") + set(DEAL_II_WITH_VALGRIND FALSE) + endif() +endif() deal_ii_pickup_tests()