Skip to content

Commit

Permalink
Merge pull request #2784 from matt335672/v0_9_z3
Browse files Browse the repository at this point in the history
Cppcheck 2.8 removed the dependency on z3
  • Loading branch information
matt335672 authored Sep 4, 2023
2 parents 4c3dd94 + 8f31163 commit 4db9323
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
with:
path: ~/cppcheck.local
key: ${{ steps.os.outputs.image }}-build-${{ env.cache-name }}-${{ env.CPPCHECK_VER }}
- run: sudo scripts/install_cppcheck_dependencies_with_apt.sh
- run: sudo scripts/install_cppcheck_dependencies_with_apt.sh $CPPCHECK_VER
- run: ./bootstrap
- run: scripts/install_cppcheck.sh $CPPCHECK_REPO $CPPCHECK_VER
- run: scripts/run_cppcheck.sh -v $CPPCHECK_VER
Expand Down
8 changes: 7 additions & 1 deletion scripts/install_cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ fi
# CFGDIR is needed for cppcheck before 1.86
make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR CFGDIR=$FILESDIR"
;;
*) make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR USE_Z3=yes"
2.8 | 2.9 | 2.1*)
# Cppcheck 2.8 removed the dependency on z3
make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR"
;;
2.*)
make_args="FILESDIR=$FILESDIR PREFIX=$FILESDIR USE_Z3=yes"
# Check that the Z3 development files appear to be installed
# before trying to create z3_version.h. Otherwise we may
# mislead the user as to what needs to be done.
Expand All @@ -138,6 +143,7 @@ fi
if [ ! -f /usr/include/z3_version.h ]; then
create_z3_version_h
fi
;;
esac

# Use all available CPUs
Expand Down
26 changes: 24 additions & 2 deletions scripts/install_cppcheck_dependencies_with_apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,27 @@ set -eufx

PACKAGES="libz3-dev z3"

apt-get update
apt-get -yq --no-install-suggests --no-install-recommends install $PACKAGES
usage()
{
echo "** Usage: $0 <version-tag>"
echo " e.g. $0 1.90"
} >&2

if [ $# -ne 1 ]; then
usage
exit 1
fi
CPPCHECK_VER="$1"

case "$CPPCHECK_VER" in
1.*)
# no dependencies
;;
2.8 | 2.9 | 2.1*)
# Cppcheck 2.8 removed the dependency on z3
;;
2.*)
apt-get update
apt-get -yq --no-install-suggests --no-install-recommends install $PACKAGES
;;
esac

0 comments on commit 4db9323

Please sign in to comment.