Skip to content

Commit

Permalink
add clang-tidy support
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaefer committed Dec 8, 2015
1 parent 8d721f6 commit b437804
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
BUILDTYPE ?= Release

ifeq ($(shell uname -s), Darwin)
export BUILD = osx
else ifeq ($(shell uname -s), Linux)
export BUILD = linux
else
$(error Cannot determine build platform)
endif


CLANG_TIDY ?= clang-tidy

all: lib

config.gypi:
Expand Down Expand Up @@ -34,6 +45,12 @@ xproj: config.gypi
deps/run_gyp geojsonvt.gyp -Iconfig.gypi --depth=. -Goutput_dir=. --generator-output=./build -f xcode
open build/geojsonvt.xcodeproj

.PHONY: tidy
tidy: config.gypi
deps/run_gyp geojsonvt.gyp -Iconfig.gypi --depth=. -Goutput_dir=. -Gconfig=$(BUILDTYPE) --generator-output=./build -f ninja
deps/ninja/ninja-$(BUILD) -C build/$(BUILDTYPE) -t compdb cc cc_s cxx objc objcxx > build/$(BUILDTYPE)/compile_commands.json
(cd build/$(BUILDTYPE) && git ls-files '../../*.cpp' | xargs -I{} $(CLANG_TIDY) -checks=* {} )

.PHONY: clean
clean:
-rm -rf build
Expand Down
Binary file added deps/ninja/ninja-linux
Binary file not shown.
Binary file added deps/ninja/ninja-osx
Binary file not shown.

0 comments on commit b437804

Please sign in to comment.