summaryrefslogtreecommitdiff
path: root/core/xmake.sh
diff options
context:
space:
mode:
authorruki <[email protected]>2022-12-18 17:04:12 +0800
committerruki <[email protected]>2022-12-18 17:04:12 +0800
commit6cebe3979a67dbbc778692571f8dbdeb33a8fecb (patch)
tree0b29b3a5c507383ddf7a6b258355775b6fca4843 /core/xmake.sh
parenta10348c895d6591d52ac557ef4b57e3a11f8298b (diff)
find tbox
Diffstat (limited to 'core/xmake.sh')
-rwxr-xr-xcore/xmake.sh25
1 files changed, 24 insertions, 1 deletions
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"