Added clang-tidy Makefile target

This commit is contained in:
Bartek Kryza
2023-01-17 00:14:35 +01:00
parent bdf55d45b7
commit 57740c0c6c
3 changed files with 27 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
.PHONY: clean
clean:
rm -rf debug release
rm -rf debug release debug_tidy
debug/CMakeLists.txt:
cmake -S . -B debug \
@@ -59,12 +59,26 @@ release/CMakeLists.txt:
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="$(CMAKE_CXX_FLAGS)" \
-DCMAKE_EXE_LINKER_FLAGS="$(CMAKE_EXE_LINKER_FLAGS)" \
-DLLVM_VERSION=${LLVM_VERSION}
-DLLVM_VERSION=${LLVM_VERSION}
debug_tidy/CMakeLists.txt:
cmake -S . -B debug_tidy \
-DGIT_VERSION=$(GIT_VERSION) \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=OFF \
-DCMAKE_CXX_FLAGS="$(CMAKE_CXX_FLAGS)" \
-DCMAKE_EXE_LINKER_FLAGS="$(CMAKE_EXE_LINKER_FLAGS)" \
-DLLVM_VERSION=${LLVM_VERSION}
debug: debug/CMakeLists.txt
echo "Using ${NUMPROC} cores"
make -C debug -j$(NUMPROC)
debug_tidy: debug_tidy/CMakeLists.txt
echo "Using ${NUMPROC} cores"
make -C debug_tidy -j$(NUMPROC)
release: release/CMakeLists.txt
make -C release -j$(NUMPROC)
@@ -106,6 +120,10 @@ clang-format:
format:
docker run --rm -v $(CURDIR):/root/sources bkryza/clang-format-check:1.3
.PHONY: debug_tidy
tidy: debug_tidy
run-clang-tidy-12 -p debug_tidy ./src
.PHONY: check-formatting
check-formatting:
./util/check_formatting.sh