From 6bea48d5f42e1baf8cc2a6080ca5cf62aaac9766 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 17 Dec 2022 18:14:02 +0800 Subject: improve deps --- core/src/xmake/xmake.sh | 6 +----- core/xmake.sh | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/core/src/xmake/xmake.sh b/core/src/xmake/xmake.sh index 6c42c9618..46cb36ca1 100755 --- a/core/src/xmake/xmake.sh +++ b/core/src/xmake/xmake.sh @@ -6,11 +6,7 @@ target "xmake" # add deps add_deps "sv" "lua" "lz4" "tbox" - if has_config "lua_cjson"; then - add_links "cjson" "{public}" - else - add_deps "lua_cjson" - fi + add_lua_cjson # add defines add_defines "__tb_prefix__=\"xmake\"" diff --git a/core/xmake.sh b/core/xmake.sh index 0b624a6c9..56d511bf9 100755 --- a/core/xmake.sh +++ b/core/xmake.sh @@ -44,8 +44,21 @@ option_end # the lua-cjson option option "lua_cjson" - add_links "cjson" + add_links "lua5.1-cjson" + add_csnippets " +int luaopen_cjson(void *l);\n +void test() {\n + luaopen_cjson(0);\n +} +" option_end +add_lua_cjson() { + if has_config "lua_cjson"; then + add_links "lua5.1-cjson" "{public}" + else + add_deps "lua_cjson" + fi +} # add projects if ! has_config "lua_cjson"; then -- cgit v1.3.1