From 4593e467c37363d86cc310e91fcbc67143ed7b88 Mon Sep 17 00:00:00 2001 From: msclock Date: Wed, 22 May 2024 16:06:54 +0800 Subject: [PATCH] fix: correct valgrind setup (#113) Signed-off-by: msclock --- cmake/test/Valgrind.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/test/Valgrind.cmake b/cmake/test/Valgrind.cmake index 98e24e5..e47d368 100644 --- a/cmake/test/Valgrind.cmake +++ b/cmake/test/Valgrind.cmake @@ -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}") @@ -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}") @@ -94,3 +96,6 @@ if(USE_VALGRIND_ENABLE_MEMCHECK) STATUS "Memory check suppressions file: ${MEMORYCHECK_SUPPRESSION_FILE}") endif() endif() + +unset(valgrind_suppress_command) +unset(_valgrind_option_str)