Skip to content

Commit

Permalink
feat: add support for clang-tidy-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 1, 2022
1 parent 7e4b7c2 commit 95fe3dc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/StaticAnalyzers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,19 @@ macro(enable_cppcheck)
endmacro()

macro(enable_clang_tidy)
# https://github.com/ejfitzgerald/clang-tidy-cache
find_program(CLANGTIDY clang-tidy)
find_program(
CLANGTIDY_CACHE
NAMES "clang-tidy-cache"
"clang-tidy-cache-windows-amd64"
"clang-tidy-cache-linux-amd64"
"clang-tidy-cache-darwin-amd64")
if(CLANGTIDY)
if(CLANGTIDY_CACHE)
set($ENV{CLANG_TIDY_CACHE_BINARY} ${CLANGTIDY})
set(CLANGTIDY ${CLANGTIDY_CACHE})
endif()
set(CMAKE_CXX_CLANG_TIDY ${CLANGTIDY} -extra-arg=-Wno-unknown-warning-option)
if(${CMAKE_CXX_STANDARD})
set(CMAKE_CXX_CLANG_TIDY ${CMAKE_CXX_CLANG_TIDY} -extra-arg=-std=c++${CMAKE_CXX_STANDARD})
Expand Down

0 comments on commit 95fe3dc

Please sign in to comment.