This is a tutorial on how to compile Lua 5.3.0 as an iOS static library (liblua.a) on Mac OS X 10.10.2 Yosemite with Xcode 6.1.1.

1. Download and extract Lua 5.3.0 to a folder of your choice.

2. Start Xcode and Create a new Xcode project -> iOS -> Framework & Library -> Cocoa Touch Static Library, then choose lua as the Product Name and create the project

3. Now on the left pane delete the lua.h and the lua.m file (Move to Trash), then right click on the now empty lua folder and choose Add Files to “lua” and select the src\ folder of the extracted lua source.

4. Open the newly added src folder in the left pane and delete lua.cluac.c and makefile(Remove Reference) as these would build the standalone interpreter and compiler (which we won’t need).

5. Change the output folder with File -> Project Settings and click the Advanced… button underDerived Data Location then choose Custom and set it to Relative to Workspace

6. Click on the lua project file (subtitled with “2 targets”) on the top left, expand the content pane by clicking on the expand icon and with a right click delete the target luaTests. Delete the folder luaTests (Move to Trash) on the left, too.

7. Set Release build with Product -> Build For -> Running

8. You may need to set a Code Signing Identy (under Code signing) and adjust the iOS Deployment target (under Deployment) to your needs.

9. Hit the compile button, you should now have a liblua.a in the Build/Products/ folder.

How to put the ios and iossim static library files into one library

After building both static libraries you may want to put the ios and iossim libraries into one library – containing both armv7 and ios vm x86/64 code:

lipo -create ./Build/Products/Debug-iphoneos/liblua.a ./Build/Products/Debug-iphonesimulator/liblua.a -output liblua.a

原地址:http://blog.spreendigital.de/2015/02/09/how-to-compile-lua-5-3-0-as-an-ios-static-library/

【转】编译Lua5.3.0的iOS静态库的更多相关文章

  1. iOS静态库及Framework 创建

    本文转自cocoachina,尊重作者的汗水. 讲述的非常透彻,有需要的朋友可以阅读实践.转载请注明出处 //=================以下留着备份==================// 在 ...

  2. iOS静态库.a文件制作和导入使用

    iOS静态库.a文件制作: 1.新建Cocoa Touch Static Library工程 新建工程 - 选择iOS-FrameWork&Libary,选择 Cocoa Touch Stat ...

  3. iOS 静态库和动态库的区别&静态库的生成

    linux中静态库和动态库的区别 一.不同 库从本质上来说是一种可执行代码的二进制格式,可以被载入内存中执行.库分静态库和动态库两种. 1. 静态函数库 这类库的名字一般是libxxx.a:利用静态函 ...

  4. iOS 静态库,动态库与 Framework 浅析

    静态库与动态库的区别 首先来看什么是库,库(Library)说白了就是一段编译好的二进制代码,加上头文件就可以供别人使用. 什么时候我们会用到库呢?一种情况是某些代码需要给别人使用,但是我们不希望别人 ...

  5. iOS - 静态库的创建与使用

    在日常项目开发中,不论是为了两个公司项目上的业务交流还是为了减少项目的编译时间,有的时候我们会把项目中的私密内容打包成静态库,或者是把项目中变动较少一部分打包成静态库以便提高编译效率,那么下面我们就来 ...

  6. ios 静态库冲突的解决办法

    最近在做一个 iOS 的 cocos2d-x 项目接入新浪微博 SDK 的时候被“坑”了,最后终于顺利的解决了.发现网上也有不少人遇到一样的问题,但是能找到的数量有限的解决办法写得都不详细,很难让人理 ...

  7. 【转】iOS静态库 【.a 和framework】【超详细】

    原文网址:https://my.oschina.net/kaqijiang/blog/649632 一.什么是库? 库是共享程序代码的方式. 库从本质上来说是一种可执行代码的二进制格式,可以被载入内存 ...

  8. iOS 静态库和动态库(库详解)

    什么是库 ? 库就是程序代码的集合,将N个文件组织起来,是共享程序代码的一种方式.库从本质上来说是一种可执行代码的二进制格式,可以被载入内存中执行. 库的分类 开源库:源代码是公开的,可以看到每个实现 ...

  9. iOS静态库 ---iOS-Apple苹果官方文档翻译

    iOS静态库 ---iOS-Apple苹果官方文档翻译 •什么是库? 库是共享程序代码的方式,一般分为静态库和动态库.静态库与动态库的区别? 静态库:链接时完整地拷贝至可执行文件中,被多次使⽤用就为什 ...

随机推荐

  1. Atitit 编程语言常用算法attilax总结

    Atitit 编程语言常用算法attilax总结 1. 编译算法分类and   数据操作算法.1 1.1. Tab driver stat  状态转换表格算法1 1.2. Nest case 词法分析 ...

  2. angularjs的resource实例对象

    angularjs的resource实例对象 我们看看都有啥 而直接使用service对象的时候没有前面这些$

  3. Liferay7 BPM门户开发之42: Liferay核心JSP定制扩展

    Liferay最大的好处是不仅接口强大,利于扩展,就连JSP定制扩展都提供了3种方式. 修改核心jsp代码,有3种修改方式:1.暴力修改直接修改(位于portal-web/docroot/html), ...

  4. seajs模块化开发

    seajs是一个起辅助作用的库,所以它可以更方便开发,而它可以解决以下问题: 1.命名问题,就是冲突 2.性能问题,就是只要一个功能,但却使用一个大插件中的一个小功能,所以要手动拆分出这个功能 3.j ...

  5. Callable、Future、RunnableFuture、FutureTask的原理及应用

    1. Callable.Future.RunnableFuture.FutureTask的继承关系 在多线程编程中,我们一般通过一个实现了Runnable接口的对象来创建一个线程,这个线程在内部会执行 ...

  6. 深入理解PHP内核(十)变量及数据类型-类型提示的实现

    原文链接:http://www.orlion.ga/253/ PHP是弱类型语言,向方法传递参数时也并不严格检查数据类型.不过有时候需要判断传递到方法中的参数,为此PHP中提供了一些函数来判断数据的类 ...

  7. 依赖注入(DI)与服务容器(IoC)

    参考文章:http://www.yuansir-web.com/2014/03/20/%E7%90%86%E8%A7%A3php-%E4%BE%9D%E8%B5%96%E6%B3%A8%E5%85%A ...

  8. html5遵循的5个设计原则

    前面的话 实际上,html5并不是由w3c直接制定的,w3c的方向是xhtml2,而不是html5.当xhtml2脱离现实,无法付诸实践时,w3c工作组才将研究方向转向html5.为什么xhtml2从 ...

  9. 错误:document.getElementById("userForm").submit();Object is not a function

    表单提交时发生的错误解决办法: 利用这种方法进行表单提交的时候,表单中的元素不能有 name="submit"的元素,否则该元素会与submit()方法造成混淆,导致错误!

  10. Java多线程系列--“基础篇”06之 线程让步

    概要 本章,会对Thread中的线程让步方法yield()进行介绍.涉及到的内容包括:1. yield()介绍2. yield()示例3. yield() 与 wait()的比较 转载请注明出处:ht ...