Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

start clang static analyzer with xcodebuild

I'm trying to set up clang static analyzer on a hudson build server and if I follow the advises in this blog post I've got the following errors:

cc1obj: error: unrecognized command line option "-fdiagnostics-print-source-range-info"
cc1obj: warnings being treated as errors
cc1obj: warning: -Wuninitialized is not supported without -O
Command /usr/local/bin/libexec/ccc-analyzer failed with exit code 1
Command /usr/local/bin/libexec/ccc-analyzer failed with exit code 1

and if I pass RUN_CLANG_STATIC_ANALYZER parameter to the xcodebuild (without using scan-build) it generates me a few plist files but I have no idea how to present those files to user because I expect for HTML output.

Does anybody succeed with this?

like image 460
Dmytro Avatar asked Nov 13 '22 21:11

Dmytro


1 Answers

With Xcode 4 you can create .xcconfig files to override any methods in the project build settings. In this case make a myConfig.xcconfig and put RUN_CLANG_STATIC_ANALYZER = YES; then you can run it by calling "xcodebuild -xcconfig myConfig.xcconfig"

like image 118
Flippinjoe Avatar answered Feb 20 '23 21:02

Flippinjoe