Add support for clang-tidy to CMake recipe.

This commit is contained in:
tastytea 2020-01-27 03:23:47 +01:00
parent 70cc91e0fc
commit 4b6d1c19e3
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 11 additions and 0 deletions

View File

@ -57,6 +57,7 @@ option(WITH_TESTS "Compile tests." NO)
option(WITH_MOZILLA "Build and install wrapper for Mozilla browsers." YES)
set(MOZILLA_NMH_DIR "${CMAKE_INSTALL_LIBDIR}/mozilla/native-messaging-hosts"
CACHE STRING "Directory for the Mozilla extension wrapper.")
option(WITH_CLANG-TIDY "Check sourcecode with clang-tidy while compiling." NO)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -64,6 +65,13 @@ set(CMAKE_CXX_EXTENSIONS OFF)
include(debug_flags)
if(WITH_CLANG-TIDY)
set(CMAKE_CXX_CLANG_TIDY
"clang-tidy"
"-header-filter=${PROJECT_SOURCE_DIR}"
"-quiet")
endif()
add_subdirectory(src)
add_subdirectory(src/lib)
add_subdirectory(include)

View File

@ -22,6 +22,7 @@
:uri-hunter: https://github.com/cpp-pm/hunter
:uri-rofi: https://github.com/davatorium/rofi
:uri-boost: https://www.boost.org/
:uri-clang-tidy: https://clang.llvm.org/extra/clang-tidy/
*remwharead* saves URIs of things you want to remember in a database along with
an URI to the archived version, the current date and time, title, description,
@ -135,6 +136,8 @@ cmake --build .
extension wrapper. The complete path is
`${CMAKE_INSTALL_PREFIX}/${MOZILLA_NMH_DIR}`.
* `-DHUNTER_ENABLED=YES` to use the package manager link:{uri-hunter}[Hunter].
* `-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.