From: Dustin L. Howett Date: Tue, 30 Jun 2026 14:43:53 +0000 (-0500) Subject: build: add ENABLE_CLANG_TIDY and CLANG_TIDY_PATH X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89efbd80dee12d62df8fbf4bbcc7ab4b9f9b34b8;p=thirdparty%2Flibarchive.git build: add ENABLE_CLANG_TIDY and CLANG_TIDY_PATH --- diff --git a/CMakeLists.txt b/CMakeLists.txt index da8ffa711..fa94a6c00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -254,6 +254,7 @@ OPTION(ENABLE_ICONV "Enable iconv support" ON) OPTION(ENABLE_TEST "Enable unit and regression tests" ON) OPTION(ENABLE_COVERAGE "Enable code coverage (GCC only, automatically sets ENABLE_TEST to ON)" FALSE) OPTION(ENABLE_INSTALL "Enable installing of libraries" ON) +OPTION(ENABLE_CLANG_TIDY "Enable custom build-time code health checks" OFF) IF(WIN32 AND MSVC) OPTION(MSVC_USE_STATIC_CRT "Use static CRT" OFF) @@ -2229,6 +2230,13 @@ IF(ENABLE_TEST) ADD_CUSTOM_TARGET(run_all_tests) ENDIF(ENABLE_TEST) +IF(ENABLE_CLANG_TIDY) + IF(NOT CLANG_TIDY_PATH) + SET(CLANG_TIDY_PATH clang-tidy) + ENDIF(NOT CLANG_TIDY_PATH) + SET(CMAKE_C_CLANG_TIDY ${CLANG_TIDY_PATH}) +ENDIF(ENABLE_CLANG_TIDY) + add_subdirectory(libarchive) add_subdirectory(cat) add_subdirectory(tar)