Building IBPlugins under Leopard and Snow Leopard


This is a pretty esoteric topic, but I ran into it and maybe the google will help somebody find my solution before they waste too much time. I have a custom control with a custom IBPlugin which we use in Cartographica. The IBPlugin compiles in all 4 binary modes, but I restricted it to ppc and i386, because the IBFramework which you have to link to doesn't support 64-bit under Leopard. Enter Snow Leopard...

So, under Snow Leopard, IB (Interface Builder) is a 64-bit application and both IB and CompileXIB complain that the plugin doesn't have the right number of bits in it. So, I need to build 64-bit, which wasn't difficult. Unfortunately, the hard part is that if you try to link the 64-bit version under Leopard, it chokes.

This wouldn't be a huge problem, since I'm building under Snow Leopard (even the 10.5 compatible version) right now, but for safety's sake and because I haven't upgraded our buildbots yet, I run the automated tests on Leopard.

My solution was rather simple, I pointed the target at a user-defined variable and then built for all architectures on Snow Leopard. For the leopard compiles (which are all done by script anyway), I just put in a define that overrides that variable at compile time and it worked fine.

Since this is built as a part of the multi-stage automated build process using dependencies, I couldn't just set up something simple, so in my case I had to make sure that the variable in question wasn't used by anything else.