如何仅在选定的源文件(Xcode)中将警告视为错误?
我已经开始cocos2d游戏开发,我想在xcode中启用“将警告视为错误”标志,但仅限于我编写的代码,而不是所有正在使用的代码(即:Cocos2D源代码)。
问题是 cocos2d 源代码中有很多警告,这些警告现在被视为错误,我不想搞乱它。我只想将警告检测为代码中的错误。
有什么方法可以选择哪些源代码将启用此标志?我是否必须创建不同的项目,每个项目都有不同的标志并与它们链接?如果是这样,我该怎么做?
谢谢!
I've started cocos2d game development and I would like to enable the flag "treat warnings as errors" in xcode, but only for the code that I write and not for all the code that is being used (ie: Cocos2D source).
The problem is that there are lots of warnings in cocos2d source code which are now being treated as errors and I do not want to mess up with this. I just want to detect warnings as errors in my code.
Is there any way to select which source code will have this flag enabled? Do I have to create different projects, each one with different flags and link with them? If so, how do I do this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的解决方案是将 cocos2d-iphone 源代码文件添加到一个单独的静态库目标中,该目标已关闭“警告作为错误”。
然后将您的应用程序目标与 cocos2d-iphone 静态库链接起来,方法是将其添加到“Link Binary with Libraries”构建阶段。
The best solution is to add the cocos2d-iphone source code files to a separate, static library target that has "warnings as errors" turned off.
Then link your app target with the cocos2d-iphone static library by adding it under "Link Binary with Libraries" build phase.