Skip to content

Commit

Permalink
fix: correct valgrind setup (#112)
Browse files Browse the repository at this point in the history
Signed-off-by: msclock <msclock@qq.com>
  • Loading branch information
msclock committed May 22, 2024
1 parent 3f9aa42 commit 808ae7b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmake/test/Valgrind.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ if(USE_VALGRIND_SUPPRESSION_FILE)
"--suppressions=${USE_VALGRIND_SUPPRESSION_FILE}")
endif()

string(REPLACE ";" " " _valgrind_option_str "${USE_VALGRIND_OPTIONS}")

set(VALGRIND_COMMAND_OPTIONS
"${USE_VALGRIND_OPTIONS} ${valgrind_suppress_command}"
"${_valgrind_option_str} ${valgrind_suppress_command}"
CACHE STRING "valgrind options" FORCE)

message(STATUS "Valgrind final options: ${VALGRIND_COMMAND_OPTIONS}")
Expand All @@ -81,7 +83,7 @@ if(USE_VALGRIND_ENABLE_MEMCHECK)
"Enable memory check with ctest command for testsuit, e.g. ctest -C Debug -D ExperimentalMemCheck"
)
set(MEMORYCHECK_COMMAND_OPTIONS
"${USE_VALGRIND_OPTIONS}"
"${_valgrind_option_str}"
CACHE STRING "memory check command options" FORCE)

message(STATUS "Memory check options: ${MEMORYCHECK_COMMAND_OPTIONS}")
Expand All @@ -94,3 +96,7 @@ if(USE_VALGRIND_ENABLE_MEMCHECK)
STATUS "Memory check suppressions file: ${MEMORYCHECK_SUPPRESSION_FILE}")
endif()
endif()


unset(valgrind_suppress_command)
unset(_valgrind_option_str)

0 comments on commit 808ae7b

Please sign in to comment.