phoboslab / JavaScriptCore-iOS

Apple's JavaScript Engine, with modified project files for iOS
695 stars 166 forks source link

[TVOS] Adds tvOS compatibility. #31

Closed darionco closed 9 years ago

darionco commented 9 years ago

This PR adds compatibility for tvOS by configuring the project files and adding a new script: maketvos.py which builds JavaScriptCore-tvOS.framework that can be used in tvOS projects.

phoboslab commented 9 years ago

Awesome!

Can you explain why this needs to be a different .framework though? Couldn't it be merged as just another slice in the same lib?

darionco commented 9 years ago

I have not tried that, I just followed Apple's examples in which they actually have different frameworks for iOS and tvOS. It made sense since tvOS is an ARM64 platform, the same as some iOS devices.

phoboslab commented 9 years ago

So, the question is, what actually makes the lib that is built for arm64 tvOS different from the one that's built for arm64 iOS? Why is it a different binary at all? Maybe it's just a flag somewhere in the lib that marks it as "tvOS compatible"?

I'll try to build the lib with your maketvos.py and then see if I can stick into the lib for iOS & Simulator.

phoboslab commented 9 years ago
> lipo -create JavaScriptCore-ios JavaScriptCore-tvos -output JavaScriptCore-universal.lib
fatal error: lipo JavaScriptCore-ios and JavaScriptCore-tvos have the same architectures (x86_64) and can't be in the same fat output file

Well, I guess we have to build two frameworks after all.

Thanks!