Commit 18e8b8df authored by David Fairbrother's avatar David Fairbrother
Browse files

Add cache dir to cppcheck

Adds a cache dir, to avoid rebuilding the entire project each time. This
should save anywhere from 25-55 minutes per build (depending on which
node this hits).
parent 3ab4dbaa
...@@ -6,13 +6,14 @@ if ( CPPCHECK_EXECUTABLE ) ...@@ -6,13 +6,14 @@ if ( CPPCHECK_EXECUTABLE )
# everything correctly # everything correctly
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set ( CPPCHECK_BUILD_DIR "${CMAKE_BINARY_DIR}/cppcheck" ) set ( CPPCHECK_BUILD_DIR "${CMAKE_BINARY_DIR}/cppcheck" )
file(MAKE_DIRECTORY "${CPPCHECK_BUILD_DIR}" ) file(MAKE_DIRECTORY "${CPPCHECK_BUILD_DIR}" "${CPPCHECK_BUILD_DIR}/cache")
configure_file(${CMAKE_SOURCE_DIR}/buildconfig/CMake/CppCheck_Suppressions.txt.in "${CPPCHECK_BUILD_DIR}/CppCheck_Suppressions.txt") configure_file(${CMAKE_SOURCE_DIR}/buildconfig/CMake/CppCheck_Suppressions.txt.in "${CPPCHECK_BUILD_DIR}/CppCheck_Suppressions.txt")
# setup the standard arguments # setup the standard arguments
# --inline-suppr appears to be ignored if --suppresions-list is specified # --inline-suppr appears to be ignored if --suppresions-list is specified
set ( CPPCHECK_ARGS --enable=all --inline-suppr --max-configs=120 set ( CPPCHECK_ARGS --enable=all --inline-suppr --max-configs=120
--std=c++${CMAKE_CXX_STANDARD} # use the standard from cmake --std=c++${CMAKE_CXX_STANDARD} # use the standard from cmake
--cppcheck-build-dir="${CPPCHECK_BUILD_DIR}/cache"
--suppressions-list="${CPPCHECK_BUILD_DIR}/CppCheck_Suppressions.txt" --suppressions-list="${CPPCHECK_BUILD_DIR}/CppCheck_Suppressions.txt"
--project=${CMAKE_BINARY_DIR}/compile_commands.json --project=${CMAKE_BINARY_DIR}/compile_commands.json
# Force cppcheck to check when we use project-wide macros # Force cppcheck to check when we use project-wide macros
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment