Re: which -arch is being built
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