summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-07-09 22:25:45 +0800
committerruki <[email protected]>2023-07-09 22:25:45 +0800
commit23b7722256773b42a8219addac2e734d86c422fc (patch)
tree01fdd5a7786f97563fd7961a796b9d0f9b082094
parentb7a82a2e449133752cca5cee2349180371999373 (diff)
improve check
-rw-r--r--xmake/modules/detect/tools/find_windres.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/xmake/modules/detect/tools/find_windres.lua b/xmake/modules/detect/tools/find_windres.lua
index fab820ec2..df2562ee3 100644
--- a/xmake/modules/detect/tools/find_windres.lua
+++ b/xmake/modules/detect/tools/find_windres.lua
@@ -21,9 +21,8 @@
-- imports
import("lib.detect.find_program")
--- check
+-- we cannot run `windres --version` to check it, because llvm-mingw/windres always return non-zero
function _check(program, opt)
- opt = opt or {}
local objectfile = os.tmpfile() .. ".o"
local resourcefile = os.tmpfile() .. ".rc"
io.writefile(resourcefile, [[
@@ -66,6 +65,8 @@ end
--
function main(opt)
opt = opt or {}
- opt.check = _check -- we cannot run `windres --version` to check it, because llvm-mingw/windres always return non-zero
+ opt.check = function (program)
+ _check(program, opt)
+ end
return find_program(opt.program or "windres", opt)
end