Skip to content

Commit 5b57fce

Browse files
authored
Merge pull request #75 from vladigr1/main
feature: cppcheck suppress CPM binary_dir
2 parents dc26100 + 8e1b9e0 commit 5b57fce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/StaticAnalyzers.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ macro(myproject_enable_cppcheck WARNINGS_AS_ERRORS CPPCHECK_OPTIONS)
1111
if("${CPPCHECK_OPTIONS}" STREQUAL "")
1212
# Enable all warnings that are actionable by the user of this toolset
1313
# style should enable the other 3, but we'll be explicit just in case
14+
set(SUPPRESS_DIR "*:${CMAKE_CURRENT_BINARY_DIR}/_deps/*.h")
15+
message(STATUS "CPPCHECK_OPTIONS suppress: ${SUPPRESS_DIR}")
1416
set(CMAKE_CXX_CPPCHECK
1517
${CPPCHECK}
1618
--template=${CPPCHECK_TEMPLATE}
@@ -26,7 +28,8 @@ macro(myproject_enable_cppcheck WARNINGS_AS_ERRORS CPPCHECK_OPTIONS)
2628
# ignores code that cppcheck thinks is invalid C++
2729
--suppress=syntaxError
2830
--suppress=preprocessorErrorDirective
29-
--inconclusive)
31+
--inconclusive
32+
--suppress=${SUPPRESS_DIR})
3033
else()
3134
# if the user provides a CPPCHECK_OPTIONS with a template specified, it will override this template
3235
set(CMAKE_CXX_CPPCHECK ${CPPCHECK} --template=${CPPCHECK_TEMPLATE} ${CPPCHECK_OPTIONS})

0 commit comments

Comments
 (0)