mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
feat: have cppcheck linter respect CACHE_DIR env variable
This commit is contained in:
parent
d1addb27aa
commit
ed8ffa7fb4
@ -80,10 +80,15 @@ ENABLED_CHECKS_REGEXP=$(join_array "|" "${ENABLED_CHECKS[@]}")
|
||||
IGNORED_WARNINGS_REGEXP=$(join_array "|" "${IGNORED_WARNINGS[@]}")
|
||||
FILES_REGEXP=$(join_array "|" "${FILES[@]}")
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
CPPCHECK_DIR=$SCRIPT_DIR/.cppcheck/
|
||||
# Check if CACHE_DIR is set and non-empty, otherwise use default .cppcheck/ directory
|
||||
if [[ -n "$CACHE_DIR" ]]; then
|
||||
CPPCHECK_DIR=$CACHE_DIR/cppcheck/
|
||||
else
|
||||
CPPCHECK_DIR=$SCRIPT_DIR/.cppcheck/
|
||||
fi
|
||||
if [ ! -d $CPPCHECK_DIR ]
|
||||
then
|
||||
mkdir $CPPCHECK_DIR
|
||||
mkdir -p $CPPCHECK_DIR
|
||||
fi
|
||||
WARNINGS=$(echo "${FILES}" | \
|
||||
xargs cppcheck --enable=all --inline-suppr --suppress=missingIncludeSystem --cppcheck-build-dir=$CPPCHECK_DIR -j "$(getconf _NPROCESSORS_ONLN)" --language=c++ --std=c++17 --template=gcc -D__cplusplus -DENABLE_WALLET -DCLIENT_VERSION_BUILD -DCLIENT_VERSION_IS_RELEASE -DCLIENT_VERSION_MAJOR -DCLIENT_VERSION_MINOR -DCOPYRIGHT_YEAR -DDEBUG -DUSE_EPOLL -DCHAR_BIT=8 -I src/ -q 2>&1 | sort -u | \
|
||||
|
Loading…
Reference in New Issue
Block a user