• 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
Xcode 2.5 CoreAudio SDK breaks UB AU projects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Xcode 2.5 CoreAudio SDK breaks UB AU projects


  • Subject: Xcode 2.5 CoreAudio SDK breaks UB AU projects
  • From: "Sophia Poirier [dfx]" <email@hidden>
  • Date: Mon, 5 Nov 2007 13:45:21 -0500

I just got bitten by an odd change in the CoreAudio SDK that's included in Xcode 2.5 that resulted in my AU projects no longer building UBs properly. Namely it's on the resource side, where faulty 'thng' resources are being created that only reference x86 code and not PPC.

After some poking around, I found that the crux of the matter is in the file /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/ AUResources.r where the following bit (from Xcode 2.4.1):

#undef  TARGET_REZ_MAC_PPC
#ifdef ppc_YES
	#define TARGET_REZ_MAC_PPC        1
#else
	#define TARGET_REZ_MAC_PPC        0
#endif

#undef  TARGET_REZ_MAC_X86
#ifdef i386_YES
	#define TARGET_REZ_MAC_X86        1
#else
	#define TARGET_REZ_MAC_X86        0
#endif



got changed to this:

// define these based on the kind of build you want to generate.
// BOTH symbols must be defined for rez to work with the defines below.
#if !defined(TARGET_REZ_MAC_PPC)
	#define TARGET_REZ_MAC_PPC 1
#endif

#if !defined(TARGET_REZ_MAC_X86)
	#define TARGET_REZ_MAC_X86 1
#endif



This was kinda baffling to me, cuz the whole ppc_YES and i386_YES thing created a very convenient way to keep the Rez defines in sync with the Xcode project architecture settings automatically. So I was wondering why that facility was removed. But none-the-less, it looked to me like the new approach would at least result in UB by default, so I was further puzzled as to why my code was not falling through into this:
#if !defined(TARGET_REZ_MAC_PPC)
#define TARGET_REZ_MAC_PPC 1
#endif
and why TARGET_REZ_MAC_PPC was already defined, and defined to 0. Poking through the include tree of AUResources.r, I found the following in /System/Library/Frameworks/CoreServices.framework/ Frameworks/CarbonCore.framework/Headers/ConditionalMacros.r:


#if !defined(TARGET_REZ_MAC_PPC)
    #define TARGET_REZ_MAC_PPC      0
#endif

Okay, that explains then why I'm getting these broken builds. But why was this changed in this manner? Even the file /Developer/ Examples/CoreAudio/ReadMe.rtf included with Xcode 2.5 still includes the following instructions:

+ Universal Builds tip:
The AudioUnit, AudioFileComponent and AudioCodec components all use a similar approach now when building
- All projects use AUResources.h to build the required resources
- This file looks for the definitions of ppc_YES and i386_YES to determine which architectures are being built
- These symbols are defined by adding the following to OTHER_REZ_FLAGS in your project:
-d ppc_$ppc -d i386_$i386
- The actual value of these symbols are then set with the normal architecture check box in your XCode project
This means that once established like this, the resource files will automatically generate appropriate resources for whichever architecture you build for.


But that's not true anymore.

And even weirder is that the version of AUResources.r included with Xcode 3 for Leopard do NOT have these changes made. Instead, the file is the same as it was in Xcode 2.4.1.

Anyway, I guess the point of this email is 1) to give other AU developers a heads up for when this bites them as well and hopefully save other people some time, and 2) a query into why this seemingly (to me) counter-productive change was made.



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


  • Follow-Ups:
    • Re: Xcode 2.5 CoreAudio SDK breaks UB AU projects
      • From: William Stewart <email@hidden>
  • Prev by Date: questions about Logic AU node properties
  • Next by Date: Trying to gifure out why adding kAudioDeviceProcessorOverload listener fails
  • Previous by thread: Re: questions about Logic AU node properties
  • Next by thread: Re: Xcode 2.5 CoreAudio SDK breaks UB AU projects
  • Index(es):
    • Date
    • Thread