summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-12-17 22:45:07 +0800
committerruki <[email protected]>2022-12-17 22:53:02 +0800
commit751c4a434fcc8786c2a120bf86ecb6a0cd40e568 (patch)
tree04fc0671a49592e49fc95c1903dbbcd769515e68
parentf480f5af5f83784b19a11289f7c57c6e4da7b67c (diff)
find lz4
-rwxr-xr-xcore/src/xmake/xmake.sh4
-rwxr-xr-xcore/xmake.sh19
2 files changed, 19 insertions, 4 deletions
diff --git a/core/src/xmake/xmake.sh b/core/src/xmake/xmake.sh
index f3e1de128..1dc399c73 100755
--- a/core/src/xmake/xmake.sh
+++ b/core/src/xmake/xmake.sh
@@ -5,8 +5,8 @@ target "xmake"
set_default false
# add deps
- add_deps "sv" "lz4" "tbox"
- local libs="lua_cjson"
+ add_deps "sv" "tbox"
+ local libs="lua_cjson lz4"
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 27c6bf869..fadc330d8 100755
--- a/core/xmake.sh
+++ b/core/xmake.sh
@@ -72,7 +72,7 @@ option_find_lua() {
option_end
}
-# the lua option
+# the luajit option
option "luajit"
add_cfuncs "lua_pushstring"
add_cincludes "lua.h" "lualib.h" "lauxlib.h"
@@ -87,6 +87,19 @@ option_find_luajit() {
option_end
}
+# the lz4 option
+option "lz4"
+ add_cfuncs "LZ4F_compressFrame"
+ add_cincludes "lz4.h" "lz4frame.h"
+ before_check "option_find_lz4"
+option_end
+
+option_find_lz4() {
+ option "lz4"
+ add_cflags `pkg-config --cflags liblz4 2>/dev/null`
+ add_ldflags `pkg-config --libs liblz4 2>/dev/null`
+ option_end
+}
# add projects
if ! has_config "lua"; then
@@ -99,8 +112,10 @@ fi
if ! has_config "lua_cjson"; then
includes "src/lua-cjson"
fi
+if ! has_config "lz4"; then
+ includes "src/lz4"
+fi
includes "src/sv"
-includes "src/lz4"
includes "src/tbox"
includes "src/xmake"
includes "src/demo"