Re: Where to look for dynamic code loading
Re: Where to look for dynamic code loading
- Subject: Re: Where to look for dynamic code loading
- From: Eric Albert <email@hidden>
- Date: Wed, 1 Mar 2006 20:03:43 -0800
On Mar 1, 2006, at 7:11 PM, Jeff DuMonthier wrote:
I'm building audio unit plugins, but have a non-audio question. My
DSP code is in C++ classes separate from the core audio classes and I
have Altivec and non-Altivec versions. It would be nice to just ship
one version and have it load the right code at run time, but I've
never gone through the trouble to figure out how. If I have a C++
bundle, what is the preferred way build the plugin bundle and have it
load either the Altivec or non-Altivec version at run time? The audio
units include code to determine whether or not Altivec is there, so I
just need to figure out how to organize the project and sub
projects/libraries as well as load them. Since this is not
objective-C, NSBundle with a principle class isn't going to work. I'm
running under 10.3, so I'm not doing universal binaries yet. One
thing at a time.
If you want to, you can do this just as you'd do it for a universal
binary. Build for two different "architectures" in Xcode -- ppc and (I
think) ppc7400, and I believe the right part of the binary will be
loaded at runtime.
Another option is to build a single binary, but switch at runtime.
Just give your classes different names and use a factory method to
return the right one based on whether the system supports AltiVec.
This is probably the simpler route if most of your code is
architecture-neutral.
Hope this helps,
Eric
_______________________________________________
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