Conditional Compilation - iOS

I've been using the cpp flag up to date, but there are times where I'd like to segment specifically for ios (versus Android or desktop) Is the flag ios, iphone or something else?

Viewing 1 to 6 (6 Total)
Conditional Compilation - iOS

Jon

Jon
Total Posts: 272
Joined: March 08, 2012

I've been using the cpp flag up to date, but there are times where I'd like to segment specifically for ios (versus Android or desktop)

Is the flag ios, iphone or something else?

Tags:
Posted on June 08, 2012 at 1:31 PM

singmajesty

singmajesty
Total Posts: 2147
Joined: August 25, 2011

Re: Conditional Compilation - iOS

Currently, you can use "iphone", "android", "webos", "blackberry", "flash", "html5", "desktop", "mobile", "web", "cpp", "js" and "neko"

On SVN, I've added "windows", "mac" and "linux", and I think I will add "ios", since that makes a little more sense for the future.

Posted on June 08, 2012 at 1:35 PM

Jon

Jon
Total Posts: 272
Joined: March 08, 2012

Re: Conditional Compilation - iOS

Thanks! That ought to be added to this recipe.

http://gist.github.com/1781096

Posted on June 08, 2012 at 1:38 PM

Jon

Jon
Total Posts: 272
Joined: March 08, 2012

Re: Conditional Compilation - iOS

One gotcha I ran into is that the "flags" you specify in the NMML files aren't necessarily the same as the ones that go into code.

For example, if I'm adding an extra framework to the NMML for an extension.

This works
<dependency name="GameKit.framework" if="ios" />

This does not
<dependency name="GameKit.framework" if="iphone" />

It would be nice if this were made consistent.

Posted on June 09, 2012 at 7:37 PM

exdev

exdev
Total Posts: 93
Joined: March 09, 2012

Re: Conditional Compilation - iOS

I was bitten by this grin
I was using :

#if ios

but it must be:

#if iphone

also the output folder is: bin/iphone

Posted on July 05, 2012 at 5:11 PM

crayfellow

crayfellow
Total Posts: 204
Joined: November 28, 2011

Re: Conditional Compilation - iOS

in NME SVN (meaning in the next haxelib release), #if ios will work. Also, the output folder is now bin/ios.

Cheers,
Patrick

Posted on July 06, 2012 at 9:36 AM