Commit 32774e63 authored by David Fairbrother's avatar David Fairbrother
Browse files

Handle RHEL using cmake3 instead of cmake in cppcheck

This explicitly checks which instance we have instead of hard coding
parent 77ea7fe3
......@@ -27,15 +27,24 @@ cd $WORKSPACE/build
find -name cppcheck.xml -delete
# configure cmake
if [ $(command -v scl) ]; then
CMAKE_EXE=cmake3
SCL_ENABLE="scl enable devtoolset-7"
else
CMAKE_EXE=cmake
SCL_ENABLE=""
fi
$SCL_ENABLE "$CMAKE_EXE --version"
if [ "$(command -v ninja)" ]; then
CMAKE_GENERATOR="-G Ninja"
elif [ "$(command -v ninja-build)" ]; then
CMAKE_GENERATOR="-G Ninja"
fi
cmake ${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=Debug -DCPPCHECK_GENERATE_XML=TRUE -DCPPCHECK_NUM_THREADS=$BUILD_THREADS ..
$SCL_ENABLE "$CMAKE_EXE ${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=Debug -DCPPCHECK_GENERATE_XML=TRUE -DCPPCHECK_NUM_THREADS=$BUILD_THREADS .."
# run cppcheck
cmake --build . --target cppcheck
$SCL_ENABLE "$CMAKE_EXE --build . --target cppcheck"
# Generate HTML report
cppcheck-htmlreport --file=cppcheck.xml --title=Embedded --report-dir=cppcheck-report
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment