Add WITH_CLANG-TIDY to CMake recipe.

This commit is contained in:
tastytea 2020-01-26 05:17:04 +01:00
parent 151103a9a1
commit 3876cf3f01
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 10 additions and 0 deletions

View File

@ -22,6 +22,7 @@ option(WITH_TESTS "Compile tests." NO)
option(WITH_EXAMPLES "Compile examples." NO)
option(WITH_DEB "Prepare for the building of .deb packages." NO)
option(WITH_RPM "Prepare for the building of .rpm packages." NO)
option(WITH_CLANG-TIDY "Check sourcecode with clang-tidy while compiling." NO)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -29,6 +30,12 @@ set(CMAKE_CXX_EXTENSIONS OFF)
include(debug_flags)
if(WITH_CLANG-TIDY)
set(CMAKE_CXX_CLANG_TIDY
"clang-tidy"
"-p=build"
"-header-filter=${PROJECT_SOURCE_DIR}"
"-quiet")
endif()
add_subdirectory(src)

View File

@ -16,6 +16,7 @@
:uri-rpm-build: http://www.rpm.org
:uri-libcurl: https://curl.haxx.se/libcurl/
:uri-nodeinfo: https://nodeinfo.diaspora.software/
:uri-clang-tidy: https://clang.llvm.org/extra/clang-tidy/
*{project}* is a C++ wrapper for the link:{uri-wp-mastodon}[Mastodon] and
link:{uri-pleroma}[Pleroma] APIs. It replaces
@ -150,6 +151,8 @@ cmake --build . -- -j$(nproc --ignore=1)
* `-DCMAKE_BUILD_TYPE=Debug` for a debug build.
* `-DWITH_TESTS=YES` if you want to compile the tests.
* `-DWITH_EXAMPLES=YES` if you want to compile the examples.
* `-DWITH_CLANG-TIDY=YES` to check the sourcecode with
link:{uri-clang-tidy}[clang-tidy] while compiling.
* One of:
** `-DWITH_DEB=YES` if you want to be able to generate a deb-package.
** `-DWITH_RPM=YES` if you want to be able to generate an rpm-package.