Confusion about ARCH build settings
Confusion about ARCH build settings
- Subject: Confusion about ARCH build settings
- From: Jeff Johnson <email@hidden>
- Date: Sun, 10 Jul 2011 15:01:16 -0500
According to the Build Setting Reference:
http://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html
ONLY_ACTIVE_ARCH (Build Active Architecture Only)
• YES: The product includes only code for the native architecture (“NATIVE_ARCH”).
• NO: The product includes code for the architectures specified in “ARCHS (Architectures).”
NATIVE_ARCH
Same as: “CURRENT_ARCH.”
CURRENT_ARCH
Same as: “NATIVE_ARCH.”
However, this all seems incorrect in practice.
Suppose I set ARCHS to x86_64 and ONLY_ACTIVE_ARCH to YES in my build settings, but I don't override NATIVE_ARCH or CURRENT_ARCH.
What actually happens, as verified by environment variables, is contrary to the documentation. NATIVE_ARCH is i386, but CURRENT_ARCH is x86_64, so obviously they are not the "Same". Furthermore, the argument -arch x86_64 is given to the compiler, which is not NATIVE_ARCH, so again this is contrary to the documentation.
The reason I'm asking all this is that I want to set up an xcconfig file for a Debug build configuration so that when xcodebuild is called from the command-line, it will automatically build only the native architecture of the build machine, whether that's i386 or x86_64, but it will also show both architectures in Xcode and allow the developer to choose one of them to build from the Xcode GUI.
I could probably play around with build settings until I get a solution that works on my test machines, but it's disconcerting that these settings are not documented better, and relying on undocumented behavior could lead to breakage with future versions of Xcode.
-Jeff
_______________________________________________
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