summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-12-17 18:14:02 +0800
committerruki <[email protected]>2022-12-17 18:14:02 +0800
commit6bea48d5f42e1baf8cc2a6080ca5cf62aaac9766 (patch)
treeb0224f66eb6218991480ebdbc9c2a58eecd7d872
parent5e6421e66209d331ea502abca335dd48684621a6 (diff)
improve deps
-rwxr-xr-xcore/src/xmake/xmake.sh6
-rwxr-xr-xcore/xmake.sh15
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