diff --git a/CMakeLists.txt b/CMakeLists.txt index ddd733f..43faf2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/README.adoc b/README.adoc index 5b0f1bc..6d5fd7b 100644 --- a/README.adoc +++ b/README.adoc @@ -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.