Unverified Commit 60175141 authored by Gagik Vardanyan's avatar Gagik Vardanyan Committed by GitHub
Browse files

Merge pull request #32460 from DavidFair/cppcheck_rhel

Handle RHEL using cmake3 instead of cmake in cppcheck
parents 0bc884fc 32774e63
...@@ -27,15 +27,24 @@ cd $WORKSPACE/build ...@@ -27,15 +27,24 @@ cd $WORKSPACE/build
find -name cppcheck.xml -delete find -name cppcheck.xml -delete
# configure cmake # 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 if [ "$(command -v ninja)" ]; then
CMAKE_GENERATOR="-G Ninja" CMAKE_GENERATOR="-G Ninja"
elif [ "$(command -v ninja-build)" ]; then elif [ "$(command -v ninja-build)" ]; then
CMAKE_GENERATOR="-G Ninja" CMAKE_GENERATOR="-G Ninja"
fi 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 # run cppcheck
cmake --build . --target cppcheck $SCL_ENABLE "$CMAKE_EXE --build . --target cppcheck"
# Generate HTML report # Generate HTML report
cppcheck-htmlreport --file=cppcheck.xml --title=Embedded --report-dir=cppcheck-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