Clang-Tidy: error out when executable not found
Stop with an error when the Clang-Tidy executable cannot be found. Without this check, CMake will happily report "Found Clang-Tidy" but with the fallback version (0, 0, 0), when `CLANG_TIDY_EXECUTABLE` points to a non-existing executable.
This commit is contained in:
parent
2acf01ec62
commit
88926375a0
|
@ -43,7 +43,10 @@ find_program(CLANG_TIDY_EXECUTABLE
|
|||
${_clang_tidy_SEARCH_DIRS}
|
||||
)
|
||||
|
||||
if(CLANG_TIDY_EXECUTABLE)
|
||||
if(CLANG_TIDY_EXECUTABLE AND NOT EXISTS ${CLANG_TIDY_EXECUTABLE})
|
||||
message(WARNING "Cached or directly specified Clang-Tidy executable does not exist.")
|
||||
set(CLANG_TIDY_FOUND FALSE)
|
||||
elseif(CLANG_TIDY_EXECUTABLE)
|
||||
# Mark clang-tidy as found.
|
||||
set(CLANG_TIDY_FOUND TRUE)
|
||||
|
||||
|
|
Loading…
Reference in New Issue