• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Compiling .cpp with Objective-C++ in only one target
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling .cpp with Objective-C++ in only one target


  • Subject: Compiling .cpp with Objective-C++ in only one target
  • From: David Dunham <email@hidden>
  • Date: Wed, 16 Sep 2009 11:34:08 -0700

I've got a 3rd party library I'm trying to build for both Mac and iPhone. I'm trying to use the same Xcode project, and creating another target (lib3rdparty and lib3rdparty-iphone).

The 3rd party source code has an #ifdef for iPhone -- and presumably their code all builds (they provided a .a but no project that builds it).

The problem I'm running into is that their .cpp files include

#ifdef ENGINE_IPHONE
#import <UIKit/UIKit.h>
#endif /* ENGINE_IPHONE */
#ifdef ENGINE_MACOSX
#include <Carbon/Carbon.h>
#endif /* ENGINE_MACOSX */

This works fine on Mac builds, but on iPhone builds, they're including Objective-C headers in a C++ build, and it fails horribly.

What I'm failing horribly at is finding where I can specify extension/ compiler mappings -- the place you say ".mm means Objective-C++." I want to say ".cpp means Objective-C++" -- but only for the lib3rdparty- iphone target.

David Dunham   Macintosh Game Developer
GameHouse Studios     +1 206 926 5722     www.gamehouse.com
    "They said it couldn't be done but sometimes it doesn't
     work out that way." -- Casey Stengel

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Xcode 3.2 syntax highlighting glitch
  • Next by Date: Re: Xcode 3.2 syntax highlighting glitch
  • Previous by thread: Re: Older iPhone SDKs
  • Next by thread: Xcode 3.1.3 -- (not) stepping into
  • Index(es):
    • Date
    • Thread