Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build JavaScriptCore for iOS device?

I've downloaded Webkit nightly build. I open JavaScriptCore and built it. Compilation done without any error. But the output was a Framework contains only OS X binary. I tried unchecking 'build active architecture only' but only desktop architectures built. (I looked in the binary with lipo tool)

Is there any simple way to do this? I'm expecting static library can be linked to my iOS app project. I'm trying to embed JSC as in-game script engine.

like image 317
eonil Avatar asked Aug 07 '10 12:08

eonil


2 Answers

It looks like there is an XCode project for JavaScriptCore that is part of the WebKit codebase. I was able to change the target SDK to iOS and the target architecture to arm6/arm7, and the dynamic framework built fine. You'll need to compile it to a static library, of course, so you'll need to create a new static library target for iOS and copy everything under Targets->JavaScriptCore into your new static library target. It may be a little tricky, but it might work.

like image 70
Ryan Avatar answered Sep 21 '22 07:09

Ryan


I forked phoboslab's repo and updated it to the latest verson from WebKit (as of last friday). It is compatible with iOS 5 and 6 and includes the Objective-C to Javascript bridge to be featured in iOS 7 (no private frameworks or function used).

You can find the repo on GitHub at: https://github.com/darionco/JavaScriptCore-iOS

I also added a ZIP file to the repo containing the library (.a) and needed header files for convenience.

Cheers!

like image 22
Dario Avatar answered Sep 20 '22 07:09

Dario