aboutsummaryrefslogtreecommitdiff
path: root/Src/external_dependencies/cpr/cmake/clang-tidy.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Src/external_dependencies/cpr/cmake/clang-tidy.cmake')
-rw-r--r--Src/external_dependencies/cpr/cmake/clang-tidy.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/Src/external_dependencies/cpr/cmake/clang-tidy.cmake b/Src/external_dependencies/cpr/cmake/clang-tidy.cmake
new file mode 100644
index 00000000..26defad2
--- /dev/null
+++ b/Src/external_dependencies/cpr/cmake/clang-tidy.cmake
@@ -0,0 +1,13 @@
+if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+ find_program(CLANG_TIDY_EXECUTABLE NAMES clang-tidy)
+ mark_as_advanced(CLANG_TIDY_EXECUTABLE)
+
+ if (${CLANG_TIDY_EXECUTABLE})
+ message(FATAL_ERROR "Clang-tidy not found")
+ else()
+ message(STATUS "Enabling clang-tidy")
+ set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE};-warnings-as-errors=*")
+ endif()
+else()
+ message(FATAL_ERROR "Clang-tidy is not supported when building for windows")
+endif()