Add support for clang-tidy to CMake recipe.
This commit is contained in:
parent
70cc91e0fc
commit
4b6d1c19e3
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue