如何减小cocos2d-x编译出的libcocos2dlua.so 体积

通过修改cocos2d-x的ccConfig.h文件,关闭不必要功能如TIFF和WEBP支持,以及在lua-bindings的Android项目中注释掉3D物理引擎相关源文件,可以有效减小libcocos2dlua.so的体积。同时,在lua_module_register函数中,可以根据需求选择性注册模块,如spine、cocos3d等,进一步优化体积。
摘要由CSDN通过智能技术生成

cocos2d-x\cocos\base\ccConfig.h

设置开关 0是不需要 1是需要

#ifndef CC_USE_TIFF
#define CC_USE_TIFF  0 //modify ycc
#endif // CC_USE_TIFF


/** Support webp or not. If your application don't use webp format picture, you can undefine this macro to save package size.
 */
#ifndef CC_USE_WEBP
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
#define CC_USE_WEBP  0
#endif
#endif // CC_USE_WEBP


/** Use physics integration API. */

#ifndef CC_USE_PHYSICS
#define CC_USE_PHYSICS 0
#endif


/** Use 3d physics integration API. */
#ifndef CC_USE_3D_PHYSICS
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值