Not same lib for iphoneos and iphonesim [QUESTION]

RedEvo

  • Posts: 325
Dears,
I'm working on Android and iOS Facebook Extension on OpenFL platform, starting from GeorgeN Android Facebook extension.
After studing OpenFL and iOS dynamics and taking inspiration from AdMob Extension from Abliblablobla I'm able to compile an OpenFL Facebook extension for iOS. But I can compile it only for device or for simulator, I can't compile in both way.

Facebook iOS SDK do not supply a .a lib like AdMob. To obtain libfacebook_ios_sdk.a you must compile source. During compile I'm able to obtain many types of libfacebook_ios_sdk.a:

Code: [Select]
.//Debug-iphoneos/libfacebook_ios_sdk.a
.//Debug-iphonesimulator/libfacebook_ios_sdk.a
.//Debug64-iphoneos/libfacebook_ios_sdk.a
.//Debug64-iphonesimulator/libfacebook_ios_sdk.a
.//facebook-ios-sdk.build/Debug-iphoneos/facebook-ios-sdk.build/Objects-normal/armv7/libfacebook_ios_sdk.a
.//facebook-ios-sdk.build/Debug-iphoneos/facebook-ios-sdk.build/Objects-normal/armv7s/libfacebook_ios_sdk.a
.//facebook-ios-sdk.build/Release-iphoneos/facebook-ios-sdk.build/Objects-normal/armv7/libfacebook_ios_sdk.a
.//facebook-ios-sdk.build/Release-iphoneos/facebook-ios-sdk.build/Objects-normal/armv7s/libfacebook_ios_sdk.a
.//Release-iphoneos/libfacebook_ios_sdk.a
.//Release-iphonesimulator/libfacebook_ios_sdk.a
.//Release64-iphoneos/libfacebook_ios_sdk.a
.//Release64-iphonesimulator/libfacebook_ios_sdk.a

but I cannot obtain a libfacebook_ios_sdk.a working for both iphoneos and iphonesimulator.
Under Release-universal folder I have a file without extension called FacebookSDK. I do not know, I'm a noob in iOS programming, if there's a way to get out a "universal" .a library from this file.

Anyway I'm thinking to solve the problem using tags in include.xml file using different tags to import libfacebook_ios_sdk.a for iphonesim and iphoneos.
I do not know if it's possible with OpenFL or Stencyl tags but I want to write something like that:

Code: [Select]
    <dependency name="ndll/iPhone/iphoneos/libfacebook_ios_sdk.a" if="iphoneos" />
    <dependency name="ndll/iPhone/iphonesim/libfacebook_ios_sdk.a" if="iphonesim" />

Obliviously these dependancy are not correct. Someone known if there's a good way to do that?

Hope this post can explain well issue I'm trying to face. Please ask me about eventual not clear part.
Thanks in advance for help and for your time, David.

« Last Edit: March 24, 2014, 11:16:11 am by Jon »
Launching RedemptionTCG Android Alpha. If you are interested contact us at info@redevogames.com

rob1221

  • *
  • Posts: 9472
So those dependency tags don't work?  What happens when you use them in include.nmml?

RedEvo

  • Posts: 325
Code: [Select]
ld: file not found: /Users/redevogames/stencylworks/games-generated/Analisi3.0.1.b/Export/ios/Analisi3.0.1.b/lib/armv7/libfacebook_ios_sdk.aApplying these dependancy will not copy libfacebook_ios_sdk.a libs in right folder. libfacebook_ios_sdk cannot be found in armv7 or i386 folder in games-generated folder.

Using
Code: [Select]
<dependency name="ndll/iPhone/iphoneos/libfacebook_ios_sdk.a" if="ios" />permit to linker to find libfacebook_ios_sdk.a in arm7 and i386 folder.

Tags used in first post, and inspired by some tags read somewhere in templates into plaf dir, seems be ignored.

Thanks, David.
Launching RedemptionTCG Android Alpha. If you are interested contact us at info@redevogames.com

rob1221

  • *
  • Posts: 9472
I guess the "iphoneos" and "iphonesim" tags aren't supported in the .nmml file.  Can't you use the source directly?

RedEvo

  • Posts: 325
Are there any other tags I can try? Is there any chance to introduce support iphoneos and iphonesim tags in nmml/xml file?
Do you mean integrate the Facebook source code directly in extension instead using compiled libraries?
May be a good idea but I'm not sure about my skill level to do that, I'm a noob with xcode and related language.

Thanks, David.
Launching RedemptionTCG Android Alpha. If you are interested contact us at info@redevogames.com

rob1221

  • *
  • Posts: 9472
Nevermind the source idea since Facebook has a gigantic pile of files.

Quote
Is there any chance to introduce support iphoneos and iphonesim tags in nmml/xml file?
You could make a feature request in the OpenFL forum.

Jon

  • *
  • Posts: 17529
From what I know, you aren't supposed to delineate between iphoneos/iphonesim. Instead, you merge the two into a single universal library and use that in both.

We had to do this in 2.2. This is the command we run for Stencyl's 2.2 engine. Adjust to your needs.

Code: [Select]
lipo -create -output libStencyl.a libStencyl-simulator.a libStencyl-device.a

RedEvo

  • Posts: 325
Jon, thank you very much.
Your is the solution.

We have a compiling OpenFL Android/iOS Facebook extension. I'm not ready to share it because I must test it on iOS and on Android to check remaining issues.

Thanks again.
David.
Launching RedemptionTCG Android Alpha. If you are interested contact us at info@redevogames.com