summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2022-12-18 17:24:55 +0800
committerGitHub <[email protected]>2022-12-18 17:24:55 +0800
commit68425b26424dbe2aead586a0e28fc76b640a3d57 (patch)
treef9e77acb0f55bfaeb62ca86826402449cd982391 /core/src
parent4e4f010e7fd1123dcbc272549f3d45f5261bc8a9 (diff)
parent6cebe3979a67dbbc778692571f8dbdeb33a8fecb (diff)
Merge pull request #3175 from xmake-io/xmake.sh
improve xmake.sh
Diffstat (limited to 'core/src')
-rwxr-xr-xcore/src/lua-cjson/xmake.sh8
m---------core/src/tbox/tbox0
-rwxr-xr-xcore/src/tbox/xmake.sh1
-rwxr-xr-xcore/src/xmake/xmake.sh30
4 files changed, 26 insertions, 13 deletions
diff --git a/core/src/lua-cjson/xmake.sh b/core/src/lua-cjson/xmake.sh
index 7ee38cc10..134173051 100755
--- a/core/src/lua-cjson/xmake.sh
+++ b/core/src/lua-cjson/xmake.sh
@@ -4,7 +4,13 @@ target "lua_cjson"
set_kind "static"
set_default false
set_warnings "all"
- add_deps "lua"
+ if is_config "runtime" "luajit" && has_config "luajit"; then
+ add_options "luajit" "{public}"
+ elif has_config "lua"; then
+ add_options "lua" "{public}"
+ else
+ add_deps "lua"
+ fi
add_files "lua-cjson/dtoa.c"
add_files "lua-cjson/lua_cjson.c"
add_files "lua-cjson/strbuf.c"
diff --git a/core/src/tbox/tbox b/core/src/tbox/tbox
-Subproject 592d19f5efd42204a2bfcf9ac3fef05e9fe251c
+Subproject 09f715aabf543981544112b929f105a77bc90f1
diff --git a/core/src/tbox/xmake.sh b/core/src/tbox/xmake.sh
index ed5d59d2a..9bd760793 100755
--- a/core/src/tbox/xmake.sh
+++ b/core/src/tbox/xmake.sh
@@ -14,6 +14,7 @@ hide_options() {
for name in $options; do
option "${name}"
set_showmenu false
+ option_end
done
}
hide_options
diff --git a/core/src/xmake/xmake.sh b/core/src/xmake/xmake.sh
index 983dc95ea..f3fe92aa1 100755
--- a/core/src/xmake/xmake.sh
+++ b/core/src/xmake/xmake.sh
@@ -5,7 +5,24 @@ target "xmake"
set_default false
# add deps
- add_deps "sv" "lua_cjson" "lua" "lz4" "tbox"
+ local libs="lua_cjson lz4 sv tbox"
+ for lib in $libs; do
+ if has_config "$lib"; then
+ add_options "$lib" "{public}"
+ else
+ add_deps "$lib"
+ fi
+ done
+ if is_config "runtime" "luajit" && has_config "luajit"; then
+ add_options "luajit" "{public}"
+ elif has_config "lua"; then
+ add_options "lua" "{public}"
+ else
+ add_deps "lua"
+ fi
+
+ # add options
+ add_options "readline" "curses" "{public}"
# add defines
add_defines "__tb_prefix__=\"xmake\""
@@ -44,14 +61,3 @@ target "xmake"
add_files "winos/*.c"
fi
- # enable readline
- if has_config "readline"; then
- add_defines "XM_CONFIG_API_HAVE_READLINE" "{public}"
- add_links "readline" "{public}"
- fi
-
- # enable curses
- if has_config "curses"; then
- add_defines "XM_CONFIG_API_HAVE_CURSES" "{public}"
- add_links "curses" "{public}"
- fi