build: skip clang-tidy on lgtm (#1792)

* build: skip clang-tidy on lgtm

* build: skip clang-tidy on appveyor

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
This commit is contained in:
Charles Kerr 2021-09-12 14:36:51 -05:00 committed by GitHub
parent 4c1b627647
commit 90605d4bd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -30,6 +30,7 @@ tr_auto_option(ENABLE_MAC "Build Mac client" AUTO)
option(ENABLE_NLS "Enable native language support" ON)
option(INSTALL_DOC "Build/install documentation" ON)
option(INSTALL_LIB "Install the library" OFF)
tr_auto_option(RUN_CLANG_TIDY "Run clang-tidy on the code" AUTO)
tr_auto_option(USE_SYSTEM_EVENT2 "Use system event2 library" AUTO)
tr_auto_option(USE_SYSTEM_DHT "Use system dht library" AUTO)
tr_auto_option(USE_SYSTEM_MINIUPNPC "Use system miniupnpc library" AUTO)
@ -613,7 +614,17 @@ else()
endif()
endif()
if(NOT CMAKE_VERSION VERSION_LESS "3.7.2")
if(RUN_CLANG_TIDY STREQUAL "AUTO")
if (DEFINED ENV{LGTM_SRC} OR DEFINED ENV{APPVEYOR}) # skip clang-tidy on LGTM/appveyor
set(RUN_CLANG_TIDY OFF)
elseif(CMAKE_VERSION VERSION_LESS "3.7.2")
set(RUN_CLANG_TIDY OFF)
else()
set(RUN_CLANG_TIDY ON)
endif()
endif()
if(RUN_CLANG_TIDY)
message(STATUS "Looking for clang-tidy")
find_program(CLANG_TIDY clang-tidy)
if (CLANG_TIDY STREQUAL "CLANG_TIDY-NOTFOUND")