Byte Tamer
Byte Tamer

Reputation: 143

How to treat warnings as errors only in selected source files (Xcode)?

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!

Upvotes: 4

Views: 255

Answers (1)

CodeSmile
CodeSmile

Reputation: 64478

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.

Upvotes: 3

Related Questions