summaryrefslogtreecommitdiff
path: root/core/src/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-19 23:36:22 +0800
committerruki <[email protected]>2023-01-19 23:36:22 +0800
commitb653884db6a9403f3ec8306f49420c5c4f1c660c (patch)
treeadac630dc10897ec60bc90ed28dc6c58570b3052 /core/src/xmake
parent685000fcb6d6eed642e3b56b345dc25caec999c4 (diff)
improve lua-cjson option
Diffstat (limited to 'core/src/xmake')
-rw-r--r--core/src/xmake/xmake.lua5
-rwxr-xr-xcore/src/xmake/xmake.sh11
2 files changed, 7 insertions, 9 deletions
diff --git a/core/src/xmake/xmake.lua b/core/src/xmake/xmake.lua
index d770c129f..d4e11040e 100644
--- a/core/src/xmake/xmake.lua
+++ b/core/src/xmake/xmake.lua
@@ -2,12 +2,15 @@ target("xmake")
set_kind("static")
-- add deps
- add_deps("sv", "lua-cjson", "lz4", "tbox")
+ add_deps("sv", "lz4", "tbox")
if is_config("runtime", "luajit") then
add_deps("luajit")
else
add_deps("lua")
end
+ if has_config("lua_cjson") then
+ add_deps("lua-cjson")
+ end
if is_plat("windows") and has_config("pdcurses") then
add_deps("pdcurses")
end
diff --git a/core/src/xmake/xmake.sh b/core/src/xmake/xmake.sh
index 709ff525b..06170e5bc 100755
--- a/core/src/xmake/xmake.sh
+++ b/core/src/xmake/xmake.sh
@@ -13,21 +13,16 @@ target "xmake"
add_deps "$lib"
fi
done
+ if has_config "lua_cjson" && ! has_config "external"; then
+ add_deps "lua_cjson"
+ fi
if is_config "runtime" "luajit"; then
- if has_config "lua_cjson"; then
- add_options "lua_cjson" "{public}"
- elif ! has_config "external"; then
- add_deps "lua_cjson"
- fi
if has_config "luajit"; then
add_options "luajit" "{public}"
elif ! has_config "external"; then
add_deps "luajit"
fi
else
- if ! has_config "external"; then
- add_deps "lua_cjson"
- fi
if has_config "lua"; then
add_options "lua" "{public}"
elif ! has_config "external"; then