summaryrefslogtreecommitdiff
path: root/core/xmake.sh
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 /core/xmake.sh
parentf480f5af5f83784b19a11289f7c57c6e4da7b67c (diff)
find lz4
Diffstat (limited to 'core/xmake.sh')
-rwxr-xr-xcore/xmake.sh19
1 files changed, 17 insertions, 2 deletions
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"