2017-10-29 16:32:39 +01:00
#!/bin/bash
# Note: Call this from a cmake build directory (e.g. cmake/) for out-of-source builds
# Examples:
# mkdir cmake && cd cmake && ../run-clang-tidy.sh
# mkdir cmake && cd cmake && ../run-clang-tidy.sh -fix
# mkdir cmake && cd cmake && ../run-clang-tidy.sh -export-fixes fixes.yaml
set -e
NUMCORES = ` nproc`
# Run cmake in current working directory, but on source that is in the same directory as this script file
2017-12-01 16:01:49 +01:00
cmake -DBUILD_TESTING= on -DCMAKE_EXPORT_COMPILE_COMMANDS= ON " ${ 0 %/* } "
# Build scrypt first. Our Makefiles call ino theirs, and this is needed to generate some header files. Clang-tidy will otherwise complain they're missing.
make -j${ NUMCORES } scrypt
2017-10-29 16:32:39 +01:00
run-clang-tidy.py -j${ NUMCORES } -quiet -header-filter " $( realpath ${ 0 %/* } ) /(src|test)/.* " $@