我想直接在Xcode Issue Navigator中显示cppcheck
输出。我怎么能这样做?
答案 0 :(得分:1)
以下是一个简单的脚本,您可以在Xcode的Run Script Phase
中添加Build Phases
:
#!/bin/bash
srcDir=src
if which cppcheck >/dev/null; then
cppcheck -j 4 --enable=all --inline-suppr $srcDir 2>cppcheck.txt 1>/dev/null
pwd=$(pwd)
sed "s|\[|${pwd}/|" cppcheck.txt | sed 's|\]: |: warning: |'
rm cppcheck.txt
else
echo "warning: cppcheck not installed, install here: http://brewformulas.org/Cppcheck"
fi