Tell Xcode to ignore a header for some targets?

Posted by William Jockusch on Stack Overflow See other posts from Stack Overflow or by William Jockusch
Published on 2011-01-02T22:37:07Z Indexed on 2011/01/02 22:54 UTC
Read the original article Hit count: 162

Filed under:
|
|
|
|

I have an Xcode project with a mac target and an iOS target. The project contains a class IPhoneOnlyClass which is used in the iOS target only. I have unchecked IPhoneOnlyClass.m from the mac target so it doesn't compile that file.

Now IphoneOnlyClass.h contains the line

#import <GameKit/GameKit.h>

When I am compiling for the mac target, Xcode gives me an error:

error: GameKit/GameKit.h: No such file or directory

I could get around this with a #ifdef, but is there a better way? I'd rather tell Xcode to ignore the header altogether when compiling the mac target.

© Stack Overflow or respective owner

Related posts about xcode

Related posts about mac