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 Feb 4, 2022
1 parent 8195bdf commit 68ac4ff
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/StaticAnalyzers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,21 @@ macro(enable_cppcheck)
endmacro()

macro(enable_clang_tidy)
find_program(CLANGTIDY clang-tidy)
# https://github.com/ejfitzgerald/clang-tidy-cache
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_CACHE)
# use clang-tidy-cache if found
set($ENV{CLANG_TIDY_CACHE_BINARY} ${CLANGTIDY_CACHE})
set(CLANGTIDY ${CLANGTIDY_CACHE})
else()
# otherwise use clang-tidy directly
find_program(CLANGTIDY clang-tidy)
endif()
if(CLANGTIDY)
if(NOT
CMAKE_CXX_COMPILER_ID
Expand Down

0 comments on commit 68ac4ff

Please sign in to comment.