Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit c548fdb

Browse files
cmake: fail build if valgrind tests are enabled and there's no valgrind
1 parent ded1b2b commit c548fdb

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/gha.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ jobs:
150150
-DCMAKE_TOOLCHAIN_FILE="${env:CMAKE_TOOLCHAIN_FILE}"
151151
-DCMAKE_INSTALL_PREFIX="${env:CMAKE_INSTALL_PREFIX}"
152152
-DTESTS_USE_FORCED_PMEM=ON
153+
-DTESTS_USE_VALGRIND=OFF
153154
-DTESTS_TBB=ON
154155
-DDEVELOPER_MODE=ON
155156
-DCXX_STANDARD="${{ matrix.CXX_STANDARD }}"

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ if(VALGRIND_FOUND)
147147
if(VALGRIND_PMEMCHECK_FOUND)
148148
add_flag(-DLIBPMEMOBJ_CPP_VG_PMEMCHECK_ENABLED=1)
149149
endif()
150+
elseif(NOT VALGRIND_FOUND AND TESTS_USE_VALGRIND)
151+
message(FATAL_ERROR "Valgrind not found, but flag TESTS_USE_VALGRIND was set.")
152+
elseif(NOT VALGRIND_FOUND)
153+
message(WARNING "Valgrind not found. Valgrind tests will not be performed.")
150154
endif()
151155

152156
# Find Clang

0 commit comments

Comments
 (0)