diff options
author | mj-xmr <mjxmr@protonmail.com> | 2020-11-04 19:27:06 +0100 |
---|---|---|
committer | mj-xmr <mjxmr@protonmail.com> | 2020-12-02 20:42:38 +0100 |
commit | e591341237e93c3cf8997b61eae5b1dc16dbb92e (patch) | |
tree | 88b96f144914ec1ebac9c1c4b6ba3172c0a828dd /CMakeLists.txt | |
parent | Merge pull request #7025 (diff) | |
download | monero-e591341237e93c3cf8997b61eae5b1dc16dbb92e.tar.xz |
Clang-tidy integrated into CMakeLists.txt
Can be called from the source directory with:
utils/health/clang-tidy-run.sh
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 050269218..3b0468cd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,20 @@ if (${CMAKE_VERSION} VERSION_GREATER "3.0.0" AND CMAKE_MAKE_PROGRAM MATCHES "nin set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${MONERO_PARALLEL_LINK_JOBS}) set(CMAKE_JOB_POOL_LINK link_job_pool) endif () +endif () + +option (USE_CLANG_TIDY_C "Lint the code with clang-tidy - variant C" OFF) +option (USE_CLANG_TIDY_CXX "Lint the code with clang-tidy - variant C++" OFF) +if (USE_CLANG_TIDY_C AND USE_CLANG_TIDY_CXX) + message(FATAL_ERROR "Enabling both USE_CLANG_TIDY_C and USE_CLANG_TIDY_CXX simultaneously crashes clang-tidy.") +endif() +if (USE_CLANG_TIDY_C OR USE_CLANG_TIDY_CXX) + include(SetClangTidy) +endif() +if (USE_CLANG_TIDY_C) + monero_clang_tidy("C") +elseif (USE_CLANG_TIDY_CXX) + monero_clang_tidy("CXX") endif() enable_language(C ASM) |