Skip to content

Commit 61cdba1

Browse files
authored
Add option for suppression file in valgrind memcheck [AP-3695] (#185)
Valgrind memcheck supports suppression files. This change allows using our cmake logic to specify a suppression file relative to the repo root. Tested: swift-nav/starling#9972
1 parent 361035b commit 61cdba1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Valgrind.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ endmacro()
294294

295295
function(swift_add_valgrind_memcheck target)
296296
set(argOption SHOW_REACHABLE TRACK_ORIGINS UNDEF_VALUE_ERRORS GENERATE_JUNIT_REPORT)
297-
set(argSingle LEAK_CHECK)
297+
set(argSingle LEAK_CHECK SUPPRESSIONS_FILE)
298298
set(argMulti JUNIT_OPTIONS)
299299

300300
set(valgrind_tool memcheck)
@@ -322,6 +322,10 @@ function(swift_add_valgrind_memcheck target)
322322
list(APPEND valgrind_tool_options "--leak-check=${x_LEAK_CHECK}")
323323
endif()
324324

325+
if (x_SUPPRESSIONS_FILE)
326+
list(APPEND valgrind_tool_options "--suppressions=${CMAKE_SOURCE_DIR}/${x_SUPPRESSIONS_FILE}")
327+
endif()
328+
325329
setup_custom_target(${valgrind_tool} ${target_name})
326330

327331
if (x_GENERATE_JUNIT_REPORT)

0 commit comments

Comments
 (0)