From 525b7be04173f4aa52d530f9ce84ff09a3c225da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Wed, 21 Aug 2024 22:05:53 +0200 Subject: [PATCH] cppcheck: use --error-exitcode=2 to fail the build on errors --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdc86e35..82d148b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -435,7 +435,7 @@ if (SQLITECPP_RUN_CPPCHECK) # add a cppcheck target to the "all" target add_custom_target(SQLiteCpp_cppcheck ALL - COMMAND ${CPPCHECK_EXECUTABLE} -j 8 cppcheck --enable=style --quiet ${CPPCHECK_ARG_TEMPLATE} ${PROJECT_SOURCE_DIR}/src + COMMAND ${CPPCHECK_EXECUTABLE} -j 8 cppcheck --enable=style --quiet ${CPPCHECK_ARG_TEMPLATE} ${PROJECT_SOURCE_DIR}/src --error-exitcode=2 ) execute_process(COMMAND "${CPPCHECK_EXECUTABLE}" --version OUTPUT_VARIABLE CPPCHECK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) message(STATUS "Found Cppcheck: ${CPPCHECK_EXECUTABLE} (found version ${CPPCHECK_VERSION})")