• 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
Re: which -arch is being built
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: which -arch is being built


  • Subject: Re: which -arch is being built
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Wed, 25 Mar 2009 12:38:58 +0100


Le 25 mars 09 à 12:19, Rich Collyer a écrit :

Is there a define or environment variable, or ______ I can use to determine which architecture my source is being built for? I need to be able to place a build directive inside my source that will use the correct code based on whether I am running under PowerPC or Intel and be able to compile the same source for other OS platforms.

It is easy in XCode to provide -D compiler options between Debug verses Release, but how about between 386 verses ppc?


You should generally not relay on architecture macros, and so, not use them, but instead focus on what you need.
For example do not use
#if __ppc__
// big endian
#elif __i386__
little endian
#endif


but if __BIG_ENDIAN__
#else
..

ditto for altivec/sse and for 32/64 bits.

That said, there is a bunch of macros available to determine the architecture

This Q&A give you a way to list all predefined macros:

http://developer.apple.com/qa/qa2005/qa1424.html



_______________________________________________
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


References: 
 >which -arch is being built (From: Rich Collyer <email@hidden>)

  • Prev by Date: which -arch is being built
  • Next by Date: Re: Export headers with static library on build?
  • Previous by thread: which -arch is being built
  • Next by thread: iPhone SDK 3.0 doesn't create 2.2.1 compatible project templates
  • Index(es):
    • Date
    • Thread