使用 xcodebuild 启动 clang 静态分析器
我正在尝试在 hudson 构建服务器上设置 clang 静态分析器,如果我遵循建议 在此博文中,我遇到以下错误:
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
如果我将 RUN_CLANG_STATIC_ANALYZER
参数传递给xcodebuild
(不使用 scan-build
)它生成了一些 plist 文件,但我不知道如何向用户呈现这些文件,因为我期望 HTML 输出。
有人成功做到这一点吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Xcode 4,您可以创建 .xcconfig 文件来覆盖项目构建设置中的任何方法。在这种情况下,创建一个 myConfig.xcconfig 并放置 RUN_CLANG_STATIC_ANALYZER = YES;然后你可以通过调用“xcodebuild -xcconfig myConfig.xcconfig”来运行它
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"
自从我提出这个问题以来已经两年多了,我决定使用 OCLint 来实现此目的。看起来是一个更可配置的选项,并且它支持 xcodebuild。
It's been more than two years since I asked this question and I decided to use OCLint for this purpose. Looks like a more configurable option and it supports xcodebuild from the box.