diff options
| author | ruki <[email protected]> | 2022-12-18 17:04:12 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-12-18 17:04:12 +0800 |
| commit | 6cebe3979a67dbbc778692571f8dbdeb33a8fecb (patch) | |
| tree | 0b29b3a5c507383ddf7a6b258355775b6fca4843 /core | |
| parent | a10348c895d6591d52ac557ef4b57e3a11f8298b (diff) | |
find tbox
Diffstat (limited to 'core')
| -rwxr-xr-x | core/src/xmake/xmake.sh | 3 | ||||
| -rwxr-xr-x | core/xmake.sh | 25 |
2 files changed, 25 insertions, 3 deletions
diff --git a/core/src/xmake/xmake.sh b/core/src/xmake/xmake.sh index 0a4bcb009..f3fe92aa1 100755 --- a/core/src/xmake/xmake.sh +++ b/core/src/xmake/xmake.sh @@ -5,8 +5,7 @@ target "xmake" set_default false # add deps - add_deps "tbox" - local libs="lua_cjson lz4 sv" + local libs="lua_cjson lz4 sv tbox" for lib in $libs; do if has_config "$lib"; then add_options "$lib" "{public}" diff --git a/core/xmake.sh b/core/xmake.sh index 36333a239..819525b9b 100755 --- a/core/xmake.sh +++ b/core/xmake.sh @@ -105,6 +105,7 @@ option_find_lz4() { option "sv" add_cfuncs "semver_tryn" add_cincludes "semver.h" + add_links "sv" before_check "option_find_sv" option_end @@ -121,6 +122,26 @@ option_find_sv() { option_end } +# the tbox option +option "tbox" + add_cfuncs "tb_exit" "tb_md5_init" "tb_charset_conv_data" + add_cincludes "tbox/tbox.h" + add_links "tbox" + before_check "option_find_tbox" +option_end + +option_find_tbox() { + option "tbox" + local dirs="/usr/local /usr" + for dir in $dirs; do + if test -f "${dir}/lib/libtbox.a"; then + add_linkdirs "${dir}/lib" + add_includedirs "${dir}/include" + break + fi + done + option_end +} # add projects if ! has_config "lua"; then @@ -139,7 +160,9 @@ fi if ! has_config "sv"; then includes "src/sv" fi -includes "src/tbox" +if ! has_config "tbox"; then + includes "src/tbox" +fi includes "src/xmake" includes "src/demo" |
