summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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