Integrate clang-tidy-8 with cmake build

We will now run clang-tidy if available as part of the standard build
with the bugprone-* and modernize-* checks

Change-Id: I4c9d3cf8712f802b912d32a443bca1584169a8b3
Signed-off-by: Ben Davis <ben.davis@arm.com>
This commit is contained in:
Ben Davis 2021-10-12 15:06:40 +01:00 committed by Matteo Franchin
parent 6ef056b517
commit a7a53ef092

View file

@ -26,6 +26,13 @@ project(VkLayer_window_system_integration)
find_package(PkgConfig REQUIRED)
pkg_check_modules(VULKAN_PKG_CONFIG vulkan)
find_program(CLANG_TIDY clang-tidy-8)
if (NOT CLANG_TIDY STREQUAL "CLANG_TIDY-NOTFOUND")
message(STATUS "Using clang-tidy: ${CLANG_TIDY}")
set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY} -checks=bugprone-*,modernize-*)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pthread -fPIC")
if (DEFINED DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")