JSBinding / Plugins & Build Mozjswrap Library
There are 2 libraries in Plugins:
- mozjs-31. This is SpiderMonkey library, built from https://github.com/cocos2d/Spidermonkey (not Mozilla official repository, used by cocos2d-js).
- mozjswrap. This is JSBinding library, it links C# and SpiderMonkey together and adds some supports specially for Unity.
For mozjs-31, if you need to rebuild it, go to url above to get more information, or go to Mozilla website, or just email me: answerwinner@gmail.com.
For mozjswrap, JSBinding already contains libraries for all supported platforms, so normally you don't need to rebuild this library.
Steps are written here in case you need them.
Download source code
for Android (use NDK)
- 1. rename the folder to jni, after rename,
jni/
mozjswrap.cpp
mozjswrap.h
Android.mk
- 2. inside the folder jni/, execute command
sh gen-android.sh
- 3. output: ../libs/armeabi-v7a/libmozjswrap.so
for Windows, Mac, iOS (use gyp, python, VisualStudio, XCode)
- 1. Download google gyp. Put the gyp folder here. Like this:
mozjswrap.h
mozjswrap.cpp
gyp/
gyp_main.py
LICENSE
- 2. install python 2.7.x. (Mine is 2.7.6)
- 3. For iOS: open moz.gyp, change js_debug to false. (line 9)
- 4. build!
Windows: double click gen-msvs2012.bat output: ./build/Release/bin/mozjswrap.dll
iOS: bash gen-ios.sh output: ./build/Release-iphoneos/libmozjswrap.a
Mac: bash gen-mac.sh output: ./build/Default/mozjswrap.bundle
back to JSBinding / Home
posted on 2016-07-06 21:47 AnswerWinner 阅读(571) 评论(0) 编辑 收藏 举报
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步