iDevGames Forums
Conditional inclusion - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: Conditional inclusion (/thread-9040.html)



Conditional inclusion - markhula - Jun 10, 2011 04:49 AM

Hi all,

My XML files are getting real slow to process on the iphone.
I've altered my code so an xml read outputs a binary; which I can then load and is of course much faster.
Problem is I don't want the XML included in my build. At the moment I have both the xml and binary.
I guess really the xml is read and used in debug mode and the binary is read and used in release build. But how do I set it so only the appropriate file is included in the relevant build rather than just both?

thanks in advance.


RE: Conditional inclusion - Skorche - Jun 10, 2011 06:19 AM

Instead of using a copy phase in your application's target, you can use a script to copy the files. The script can check the build configuration and do the appropriate thing. You'll have to look up how XCode names the shell variables though, I haven't touched that in a while.


RE: Conditional inclusion - markhula - Jun 13, 2011 03:07 AM

Hey Scott,

That sounds like a plan!. Would of thought Xcode would have some facility for this built-in you know like a tick box for "include in DEBUG or include in RELEASE". Will check it out.

thanks as always.

Cheers