summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/packages/find_zlib.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-12-01 00:42:11 +0800
committerruki <[email protected]>2018-11-30 22:13:10 +0800
commit4b5c554e53ca52e80c66f698d41f999a4664c7d4 (patch)
treeeedef660a3594d5d87df0a3fed8efd8097463ea3 /xmake/modules/detect/packages/find_zlib.lua
parent55cebc0c6439c674088a18d3cc289f9f03d666f3 (diff)
improve find_package to get version
Diffstat (limited to 'xmake/modules/detect/packages/find_zlib.lua')
-rw-r--r--xmake/modules/detect/packages/find_zlib.lua14
1 files changed, 6 insertions, 8 deletions
diff --git a/xmake/modules/detect/packages/find_zlib.lua b/xmake/modules/detect/packages/find_zlib.lua
index e31065f6e..56a76f4cd 100644
--- a/xmake/modules/detect/packages/find_zlib.lua
+++ b/xmake/modules/detect/packages/find_zlib.lua
@@ -63,14 +63,12 @@ function main(opt)
-- save include directory
table.insert(result.includedirs, includedir)
- -- match version
- if opt.version then
- local zlib_h = io.readfile(path.join(includedir, "zlib.h"))
- if zlib_h then
- local version = zlib_h:match("#define ZLIB_VERSION \"(%d+%.?%d+%.?%d+)\"")
- if version ~= opt.version then
- return
- end
+ -- get version
+ local zlib_h = io.readfile(path.join(includedir, "zlib.h"))
+ if zlib_h then
+ local version = zlib_h:match("#define ZLIB_VERSION \"(%d+%.?%d+%.?%d+)\"")
+ if version then
+ result.version = version
end
end
end