mirror of
https://github.com/tbamud/tbamud.git
synced 2025-09-21 21:40:49 +02:00
Added support for clang-tidy, if available.
This commit is contained in:
parent
513a7a1d95
commit
42d8242681
2 changed files with 19 additions and 0 deletions
8
.clang-tidy
Normal file
8
.clang-tidy
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
Checks: >
|
||||||
|
-*,
|
||||||
|
clang-analyzer-*,
|
||||||
|
bugprone-*,
|
||||||
|
performance-*,
|
||||||
|
portability-*
|
||||||
|
#WarningsAsErrors: '*'
|
||||||
|
HeaderFilterRegex: 'src/.*'
|
|
@ -34,6 +34,17 @@ if (CMAKE_COMPILER_IS_GNUCC)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# clang-tidy if available
|
||||||
|
find_program(CLANG_TIDY_EXE NAMES clang-tidy)
|
||||||
|
|
||||||
|
if(CLANG_TIDY_EXE AND STATIC_ANALYSIS)
|
||||||
|
message(STATUS "clang-tidy enabled: ${CLANG_TIDY_EXE}")
|
||||||
|
set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE}")
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
else()
|
||||||
|
message(WARNING "clang-tidy not found. Static analysis disabled.")
|
||||||
|
endif()
|
||||||
|
|
||||||
# ========== Header checks ==========
|
# ========== Header checks ==========
|
||||||
check_include_file("fcntl.h" HAVE_FCNTL_H)
|
check_include_file("fcntl.h" HAVE_FCNTL_H)
|
||||||
check_include_file("errno.h" HAVE_ERRNO_H)
|
check_include_file("errno.h" HAVE_ERRNO_H)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue