From b1143bde71bb029ac2bf7d08ba422fcdaedd56a6 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 31 Oct 2025 07:19:16 +0100 Subject: build: enable linting --- CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d45997..8e53923 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,12 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules") include("ElfTransformations") include("GenerateBootableIso") +#[============================================================================[ +# Global Build System Options +#]============================================================================] + +option(TEACHOS_ENABLE_LINTING "Enable linting during build" ON) + #[============================================================================[ # Global Build System Configuration #]============================================================================] @@ -31,6 +37,17 @@ add_compile_options( "$<$:-pedantic-errors>" ) +#[============================================================================[ +# Global Linting Configuration +#]============================================================================] + +find_program(CLANG_TIDY_EXE "clang-tidy") + +if(CLANG_TIDY_EXE AND TEACHOS_ENABLE_LINTING) + set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE}") + set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}") +endif() + #[============================================================================[ # Kernel Executable #]============================================================================] -- cgit v1.2.3