mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-25 15:16:02 +00:00
NOISSUE Add minimal thing for clang-tidy integration
This commit is contained in:
parent
fe75a7f09e
commit
fdedf7078e
@ -21,6 +21,20 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(Launcher_RUN_CLANG_TIDY "Run clang-tidy with the compiler." OFF)
|
||||
if(Launcher_RUN_CLANG_TIDY)
|
||||
find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
|
||||
if(NOT CLANG_TIDY_COMMAND)
|
||||
message(WARNING "CMake_RUN_CLANG_TIDY is ON but clang-tidy is not found!")
|
||||
set(DO_CLANG_TIDY "" CACHE STRING "" FORCE)
|
||||
else()
|
||||
set(CLANG_TIDY_CHECKS "-modernize-use-trailing-return-type,-readability-magic-numbers,-modernize-avoid-c-arrays")
|
||||
set(DO_CLANG_TIDY "${CLANG_TIDY_COMMAND};-checks=${CLANG_TIDY_CHECKS};-header-filter='${CMAKE_SOURCE_DIR}/src/*'")
|
||||
endif()
|
||||
# TODO: make this per-target, differentiate between libraries and main codebase
|
||||
set(CMAKE_CXX_CLANG_TIDY ${DO_CLANG_TIDY})
|
||||
endif()
|
||||
|
||||
|
||||
##################################### Set CMake options #####################################
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
Loading…
Reference in New Issue
Block a user