Add WITH_CLANG-TIDY to CMake recipe.
This commit is contained in:
parent
151103a9a1
commit
3876cf3f01
|
@ -22,6 +22,7 @@ option(WITH_TESTS "Compile tests." NO)
|
||||||
option(WITH_EXAMPLES "Compile examples." NO)
|
option(WITH_EXAMPLES "Compile examples." NO)
|
||||||
option(WITH_DEB "Prepare for the building of .deb packages." 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_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 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
@ -29,6 +30,12 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
include(debug_flags)
|
include(debug_flags)
|
||||||
|
|
||||||
|
if(WITH_CLANG-TIDY)
|
||||||
|
set(CMAKE_CXX_CLANG_TIDY
|
||||||
|
"clang-tidy"
|
||||||
|
"-p=build"
|
||||||
|
"-header-filter=${PROJECT_SOURCE_DIR}"
|
||||||
|
"-quiet")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
:uri-rpm-build: http://www.rpm.org
|
:uri-rpm-build: http://www.rpm.org
|
||||||
:uri-libcurl: https://curl.haxx.se/libcurl/
|
:uri-libcurl: https://curl.haxx.se/libcurl/
|
||||||
:uri-nodeinfo: https://nodeinfo.diaspora.software/
|
: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
|
*{project}* is a C++ wrapper for the link:{uri-wp-mastodon}[Mastodon] and
|
||||||
link:{uri-pleroma}[Pleroma] APIs. It replaces
|
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.
|
* `-DCMAKE_BUILD_TYPE=Debug` for a debug build.
|
||||||
* `-DWITH_TESTS=YES` if you want to compile the tests.
|
* `-DWITH_TESTS=YES` if you want to compile the tests.
|
||||||
* `-DWITH_EXAMPLES=YES` if you want to compile the examples.
|
* `-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:
|
* One of:
|
||||||
** `-DWITH_DEB=YES` if you want to be able to generate a deb-package.
|
** `-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.
|
** `-DWITH_RPM=YES` if you want to be able to generate an rpm-package.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user