Skip to content

Commit

Permalink
perf: suppress built-in search include path (#102)
Browse files Browse the repository at this point in the history
Signed-off-by: msclock <msclock@qq.com>
  • Loading branch information
msclock authored Apr 14, 2024
1 parent cc1b755 commit 2762178
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmake/build/Cppcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ set(USE_CPPCHECK_OPTIONS
--inconclusive
CACHE STRING "cppcheck run options")

cmake_path(NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/_deps/)

set(USE_CPPCHECK_SUPPRESS_DIR
"*:${CMAKE_CURRENT_BINARY_DIR}/_deps/*.h"
"*:${CMAKE_CURRENT_BINARY_DIR}/_deps/*"
CACHE STRING "Directory to suppress cppcheck warnings")

set(USE_CPPCHECK_WARNINGS_AS_ERRORS
Expand Down Expand Up @@ -67,8 +69,9 @@ else()
endif()

if(VCPKG_INSTALLED_DIR AND VCPKG_TARGET_TRIPLET)
list(APPEND USE_CPPCHECK_OPTIONS -I
${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include)
list(APPEND USE_CPPCHECK_OPTIONS
-I${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include
--suppress=*:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/*)
endif()

set(CMAKE_CXX_CPPCHECK
Expand Down

0 comments on commit 2762178

Please sign in to comment.