]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Bugfix: only set up valgrind wrapper when needed 17215/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 5 Jul 2024 19:31:39 +0000 (14:31 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 5 Jul 2024 19:31:39 +0000 (14:31 -0500)
tests/performance/CMakeLists.txt

index 2583a5e10a5331fb22274f799c2e99cb6c9090ff..f153e019edc317b61487e2d2e95aeb23e5d8f985 100644 (file)
@@ -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()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.