summaryrefslogtreecommitdiff
path: root/xmake/modules/lib/detect/check_cxsnippets.lua
diff options
context:
space:
mode:
authorzeromake <[email protected]>2023-11-01 23:24:20 +0800
committerzeromake <[email protected]>2023-11-01 23:24:20 +0800
commit552f8e7af8846c4aa87040361bf8a1727d8c15d5 (patch)
treed8d8b9aedda5b8f061d1bba7746c0e67b6843557 /xmake/modules/lib/detect/check_cxsnippets.lua
parent63a5c56f2b26a46729800d1447b721604ffbcbf3 (diff)
fix: binaryfind use match pattern
Diffstat (limited to 'xmake/modules/lib/detect/check_cxsnippets.lua')
-rw-r--r--xmake/modules/lib/detect/check_cxsnippets.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/lib/detect/check_cxsnippets.lua b/xmake/modules/lib/detect/check_cxsnippets.lua
index d74499ea3..310c55fa0 100644
--- a/xmake/modules/lib/detect/check_cxsnippets.lua
+++ b/xmake/modules/lib/detect/check_cxsnippets.lua
@@ -259,7 +259,11 @@ function main(snippets, opt)
end
if opt.binaryfind then
local content = io.readfile(binaryfile, {encoding = "binary"})
- return opt.binaryfind(content)
+ local match = content:match(opt.binaryfind)
+ if match == nil then
+ return false
+ end
+ return true, match
end
return true
end,