Skip to content

Commit

Permalink
Merge pull request #75 from vladigr1/main
Browse files Browse the repository at this point in the history
feature: cppcheck suppress CPM binary_dir
  • Loading branch information
lefticus authored Mar 18, 2024
2 parents dc26100 + 8e1b9e0 commit 5b57fce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmake/StaticAnalyzers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ macro(myproject_enable_cppcheck WARNINGS_AS_ERRORS CPPCHECK_OPTIONS)
if("${CPPCHECK_OPTIONS}" STREQUAL "")
# Enable all warnings that are actionable by the user of this toolset
# style should enable the other 3, but we'll be explicit just in case
set(SUPPRESS_DIR "*:${CMAKE_CURRENT_BINARY_DIR}/_deps/*.h")
message(STATUS "CPPCHECK_OPTIONS suppress: ${SUPPRESS_DIR}")
set(CMAKE_CXX_CPPCHECK
${CPPCHECK}
--template=${CPPCHECK_TEMPLATE}
Expand All @@ -26,7 +28,8 @@ macro(myproject_enable_cppcheck WARNINGS_AS_ERRORS CPPCHECK_OPTIONS)
# ignores code that cppcheck thinks is invalid C++
--suppress=syntaxError
--suppress=preprocessorErrorDirective
--inconclusive)
--inconclusive
--suppress=${SUPPRESS_DIR})
else()
# if the user provides a CPPCHECK_OPTIONS with a template specified, it will override this template
set(CMAKE_CXX_CPPCHECK ${CPPCHECK} --template=${CPPCHECK_TEMPLATE} ${CPPCHECK_OPTIONS})
Expand Down

0 comments on commit 5b57fce

Please sign in to comment.