diff options
| author | ruki <[email protected]> | 2023-01-21 00:45:46 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-01-21 00:45:46 +0800 |
| commit | f2565e2849beb5a9f5730d6ee93a268fcea59189 (patch) | |
| tree | e053d5b415114089d668b40834530e2ea80aa515 | |
| parent | b0734d56173d4789dd882d68491b1ff8343683c2 (diff) | |
fix xmake.sh
| -rwxr-xr-x | core/src/lua-cjson/xmake.sh | 20 | ||||
| -rwxr-xr-x | core/src/xmake/xmake.sh | 41 | ||||
| -rwxr-xr-x | core/xmake.sh | 27 |
3 files changed, 40 insertions, 48 deletions
diff --git a/core/src/lua-cjson/xmake.sh b/core/src/lua-cjson/xmake.sh index f3ab17546..76650cf3f 100755 --- a/core/src/lua-cjson/xmake.sh +++ b/core/src/lua-cjson/xmake.sh @@ -4,16 +4,20 @@ target "lua_cjson" set_kind "static" set_default false set_warnings "all" - if is_config "runtime" "luajit"; then - if has_config "luajit"; then - add_options "luajit" "{public}" - elif ! has_config "external"; then - add_deps "luajit" + if has_config "external"; then + if is_config "runtime" "luajit"; then + if has_config "luajit"; then + add_options "luajit" "{public}" + fi + else + if has_config "lua"; then + add_options "lua" "{public}" + fi fi else - if has_config "lua"; then - add_options "lua" "{public}" - elif ! has_config "external"; then + if is_config "runtime" "luajit"; then + add_deps "luajit" + else add_deps "lua" fi fi diff --git a/core/src/xmake/xmake.sh b/core/src/xmake/xmake.sh index 06170e5bc..dc45ecbca 100755 --- a/core/src/xmake/xmake.sh +++ b/core/src/xmake/xmake.sh @@ -5,27 +5,30 @@ target "xmake" set_default false # add deps - local libs="lz4 sv tbox" - for lib in $libs; do - if has_config "$lib"; then - add_options "$lib" "{public}" - elif ! has_config "external"; then - 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 "luajit"; then - add_options "luajit" "{public}" - elif ! has_config "external"; then - add_deps "luajit" + if has_config "external"; then + local libs="lz4 sv tbox" + for lib in $libs; do + if has_config "$lib"; then + add_options "$lib" "{public}" + fi + done + if is_config "runtime" "luajit"; then + if has_config "luajit"; then + add_options "luajit" "{public}" + fi + else + if has_config "lua"; then + add_options "lua" "{public}" + fi fi else - if has_config "lua"; then - add_options "lua" "{public}" - elif ! has_config "external"; then + local libs="lua_cjson lz4 sv tbox" + for lib in $libs; do + add_deps "$lib" + done + if is_config "runtime" "luajit"; then + add_deps "luajit" + else add_deps "lua" fi fi diff --git a/core/xmake.sh b/core/xmake.sh index f8427d133..3b8a785a6 100755 --- a/core/xmake.sh +++ b/core/xmake.sh @@ -38,9 +38,6 @@ option "runtime" "Use luajit or lua runtime" "lua" # always use external dependencies option "external" "Always use external dependencies" false -# use lua-cjson? -option "lua_cjson" "Use lua-cjson as json parser" true - # the readline option option "readline" add_links "readline" @@ -208,26 +205,14 @@ option_find_tbox() { # add projects if ! has_config "external"; then if is_config "runtime" "luajit"; then - if ! has_config "luajit"; then - includes "src/luajit" - fi + includes "src/luajit" else - if ! has_config "lua"; then - includes "src/lua" - fi - fi - if has_config "lua_cjson"; then - includes "src/lua-cjson" - fi - if ! has_config "lz4"; then - includes "src/lz4" - fi - if ! has_config "sv"; then - includes "src/sv" - fi - if ! has_config "tbox"; then - includes "src/tbox" + includes "src/lua" fi + includes "src/lua-cjson" + includes "src/lz4" + includes "src/sv" + includes "src/tbox" fi includes "src/xmake" includes "src/demo" |
