From 27621788f5144058da80e18ed8d8ed9a4f47221d Mon Sep 17 00:00:00 2001 From: msclock Date: Sun, 14 Apr 2024 23:34:20 +0800 Subject: [PATCH] perf: suppress built-in search include path (#102) Signed-off-by: msclock --- cmake/build/Cppcheck.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/build/Cppcheck.cmake b/cmake/build/Cppcheck.cmake index c1c43cb..483a62b 100644 --- a/cmake/build/Cppcheck.cmake +++ b/cmake/build/Cppcheck.cmake @@ -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 @@ -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