如何在 cocos2d-x-3.17.2-oh 适配鸿蒙项目中使用 CMake 导入 Lua 扩展库?

Android项目的做法是:

在适配鸿蒙的 cocos2d-x-3.17.2-oh 分支中新增了:

cocos2d-x\cocos\scripting\lua-bindings\proj.ohos\CMakeLists.txt

请问如何修改这个CMakeLists.txt 导入 Lua 扩展库,做 Openharmony 支持?

  • DevEco Studio编译’tests\lua-tests\project\proj.ohos’工程,错误提示如下:
ld.lld: error: undefined symbol: luaopen_lfs
>>> referenced by lua_extensions.c
>>>               lua_extensions.c.o:(luax_exts) in archive lib/libluacocos2d.a

ld.lld: error: undefined symbol: luaopen_zlib
>>> referenced by lua_extensions.c
>>>               lua_extensions.c.o:(luax_exts) in archive lib/libluacocos2d.a

ld.lld: error: undefined symbol: luaopen_pack
>>> referenced by lua_extensions.c
>>>               lua_extensions.c.o:(luax_exts) in archive lib/libluacocos2d.a

ld.lld: error: undefined symbol: luaopen_lpeg
>>> referenced by lua_extensions.c
>>>               lua_extensions.c.o:(luax_exts) in archive lib/libluacocos2d.a

ld.lld: error: undefined symbol: luaopen_cjson_safe
>>> referenced by lua_extensions.c
>>>               lua_extensions.c.o:(luax_exts) in archive lib/libluacocos2d.a

ld.lld: error: undefined symbol: luaopen_lsqlite3
>>> referenced by lua_extensions.c
>>>               lua_extensions.c.o:(luax_exts) in archive lib/libluacocos2d.a