Skip to content

Commit

Permalink
Find Valgrind only on Unix
Browse files Browse the repository at this point in the history
  • Loading branch information
tuokri committed Jun 25, 2024
1 parent 45a29d2 commit 170236d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,18 @@ option(UMB_INCLUDE_META "include meta/reflection C++ templates" ON)
option(UMB_RUN_CLANG_FORMAT "run clang-format on generated C++ files" ON)

if (BUILD_TESTS)
find_program(MEMORYCHECK_COMMAND valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --track-origins=yes --error-exitcode=1")
# TODO: make this optional even on Unix builds?
if (UNIX)
find_program(

Check failure on line 194 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / ubuntu-24.04-Debug-CMake build and tests

Could not find MEMORYCHECK_COMMAND using the following names: valgrind

Check failure on line 194 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / ubuntu-24.04-Release-CMake build and tests

Could not find MEMORYCHECK_COMMAND using the following names: valgrind
MEMORYCHECK_COMMAND
NAMES
valgrind
HINTS
$ENV{UMB_VALGRIND_BIN} # Used in GitHub Actions.
REQUIRED
)
set(MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --track-origins=yes --error-exitcode=1")
endif ()
include(CTest)
enable_testing()
add_subdirectory(tests)
Expand Down

0 comments on commit 170236d

Please sign in to comment.