pbc在Android Studio上打包所需要的CMakeLists.txt 文件

1 篇文章 0 订阅

对链接的补充
https://blog.csdn.net/u013654125/article/details/73381633

下面是CMakeLists.txt文件内容

cmake_minimum_required(VERSION 3.6)
set(lib_name pbc)
set(target_name ext_${lib_name})

project(${lib_name})

include(../cmake/CocosExternalConfig.cmake)

set(${target_name}_src
        alloc.c
        array.c
        bootstrap.c
        context.c
        decode.c
        map.c
        pattern.c
        proto.c
        register.c
        rmessage.c
        stringpool.c
        varint.c
        wmessage.c
        )

add_library(${target_name} STATIC
        ${${target_name}_src}
        )
target_include_directories(${target_name} PUBLIC ..)

if(WINDOWS)
    set_target_properties(${sub_target_name} PROPERTIES
            IMPORTED_LOCATION "${platform_spec_path}/lib${target_name}-1_1.dll"
            IMPORTED_IMPLIB "${platform_spec_path}/lib${target_name}.lib"
            )
else()
    set_target_properties(${sub_target_name} PROPERTIES
            IMPORTED_LOCATION "${target_name}.a"
            )
endif()




frameworks\cocos2d-x\cocos\scripting\lua-bindings
CMakeLists.txt
添加以下代码

set(lua_bindings_manual_headers
	...
   	manual/pbc/pbc-lua.h 
    manual/pbc/lua_cocos2dx_pbc_manual.h

  )
set(lua_bindings_manual_files
    manual/CCLuaBridge.cpp
    ...
    manual/pbc/pbc-lua.c
    manual/pbc/lua_cocos2dx_pbc_manual.cpp
    )

frameworks\cocos2d-x\external\CMakeLists.txt

添加
add_subdirectory(md5)下面添加代码

add_subdirectory(pbc)

ext_md5下面添加

ext_pbc

然后使用CMake 编译方式的打包apk就可以了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值