diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-11-06 16:34:04 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-11-06 20:08:25 +0300 |
commit | 88926375a0e4e45f72c87b9e487c060ddd3c9216 (patch) | |
tree | 9f093f8a25777959c0d51479a2f8bc3586fb57f4 /build_files | |
parent | 2acf01ec62158229d62944a3adac96fe370e040a (diff) |
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.
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/cmake/Modules/FindClangTidy.cmake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/build_files/cmake/Modules/FindClangTidy.cmake b/build_files/cmake/Modules/FindClangTidy.cmake index d576ad8f100..04c5dfda448 100644 --- a/build_files/cmake/Modules/FindClangTidy.cmake +++ b/build_files/cmake/Modules/FindClangTidy.cmake @@ -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) |