1
0

clang-tidy.cmake 485 B

12345678910111213
  1. if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
  2. find_program(CLANG_TIDY_EXECUTABLE NAMES clang-tidy)
  3. mark_as_advanced(CLANG_TIDY_EXECUTABLE)
  4. if (${CLANG_TIDY_EXECUTABLE})
  5. message(FATAL_ERROR "Clang-tidy not found")
  6. else()
  7. message(STATUS "Enabling clang-tidy")
  8. set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE};-warnings-as-errors=*")
  9. endif()
  10. else()
  11. message(FATAL_ERROR "Clang-tidy is not supported when building for windows")
  12. endif()