[build] Update compdb & tidy for Linux & OS X
This commit is contained in:
20
Makefile
20
Makefile
@@ -288,16 +288,30 @@ check: test
|
||||
scripts/collect-coverage.sh $(LINUX_OUTPUT_PATH)/$(BUILDTYPE)
|
||||
|
||||
# Generates a compilation database with ninja for use in clang tooling
|
||||
compdb: platform/linux/platform.gyp $(LINUX_OUTPUT_PATH)/config.gypi
|
||||
compdb: compdb-$(HOST_PLATFORM)
|
||||
|
||||
compdb-linux: platform/linux/platform.gyp $(LINUX_OUTPUT_PATH)/config.gypi
|
||||
$(GYP) -f ninja -I $(LINUX_OUTPUT_PATH)/config.gypi \
|
||||
--generator-output=$(LINUX_OUTPUT_PATH) $<
|
||||
deps/ninja/ninja-linux -C $(LINUX_OUTPUT_PATH)/$(BUILDTYPE) \
|
||||
-t compdb cc cc_s cxx objc objcxx > $(LINUX_OUTPUT_PATH)/$(BUILDTYPE)/compile_commands.json
|
||||
|
||||
tidy: compdb
|
||||
deps/ninja/ninja-linux -C $(LINUX_OUTPUT_PATH)/$(BUILDTYPE) version shaders
|
||||
compdb-osx: platform/osx/platform.gyp $(OSX_OUTPUT_PATH)/config.gypi
|
||||
$(GYP) -f ninja -I $(OSX_OUTPUT_PATH)/config.gypi \
|
||||
--generator-output=$(OSX_OUTPUT_PATH) $<
|
||||
deps/ninja/ninja-osx -C $(OSX_OUTPUT_PATH)/$(BUILDTYPE) \
|
||||
-t compdb cc cc_s cxx objc objcxx > $(OSX_OUTPUT_PATH)/$(BUILDTYPE)/compile_commands.json
|
||||
|
||||
tidy: compdb tidy-$(HOST_PLATFORM)
|
||||
|
||||
tidy-linux:
|
||||
deps/ninja/ninja-linux -C $(LINUX_OUTPUT_PATH)/$(BUILDTYPE) platform-lib test
|
||||
scripts/clang-tidy.sh $(LINUX_OUTPUT_PATH)/$(BUILDTYPE)
|
||||
|
||||
tidy-osx:
|
||||
deps/ninja/ninja-osx -C $(OSX_OUTPUT_PATH)/$(BUILDTYPE) platform-lib test
|
||||
scripts/clang-tidy.sh $(OSX_OUTPUT_PATH)/$(BUILDTYPE)
|
||||
|
||||
#### Miscellaneous targets #####################################################
|
||||
|
||||
style-code:
|
||||
|
||||
@@ -12,6 +12,11 @@ command -v ${CLANG_TIDY:-clang-tidy} >/dev/null 2>&1 || {
|
||||
if [ -z ${CLANG_TIDY} ]; then
|
||||
echo "Alternatively, you can set CLANG_TIDY to point to clang-tidy."
|
||||
fi
|
||||
if [ `uname -s` = 'Linux' ]; then
|
||||
echo "On Debian-based distros, you can install them via 'apt-get install clang-tidy'"
|
||||
elif [ `uname -s` = 'Darwin' ]; then
|
||||
echo "On OS X, you can install them via 'brew install llvm --with-clang --with-clang-extra-tools'"
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user