mirror of
https://github.com/transmission/transmission
synced 2024-12-21 23:32:35 +00:00
build: fail if clang-tidy is not found when -DRUN_CLANG_TIDY=ON
(#7210)
This commit is contained in:
parent
f0e7c3ed74
commit
1f36458e10
1 changed files with 7 additions and 6 deletions
|
@ -761,19 +761,20 @@ else()
|
|||
endif()
|
||||
endif()
|
||||
|
||||
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)
|
||||
else()
|
||||
set(RUN_CLANG_TIDY ON)
|
||||
endif()
|
||||
if(RUN_CLANG_TIDY STREQUAL "AUTO" AND (DEFINED ENV{LGTM_SRC} OR DEFINED ENV{APPVEYOR})) # skip clang-tidy on LGTM/appveyor
|
||||
set(RUN_CLANG_TIDY OFF)
|
||||
endif()
|
||||
|
||||
if(RUN_CLANG_TIDY)
|
||||
tr_get_required_flag(RUN_CLANG_TIDY CLANG_TIDY_IS_REQUIRED)
|
||||
|
||||
message(STATUS "Looking for clang-tidy")
|
||||
find_program(CLANG_TIDY clang-tidy)
|
||||
if(CLANG_TIDY STREQUAL "CLANG_TIDY-NOTFOUND")
|
||||
message(STATUS "Looking for clang-tidy - not found")
|
||||
if(CLANG_TIDY_IS_REQUIRED)
|
||||
message(FATAL_ERROR "clang-tidy is required but wasn't found")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Looking for clang-tidy - found")
|
||||
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY}")
|
||||
|
|
Loading…
Reference in a new issue