diff options
| author | ruki <[email protected]> | 2023-07-09 22:25:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-07-09 22:25:45 +0800 |
| commit | 23b7722256773b42a8219addac2e734d86c422fc (patch) | |
| tree | 01fdd5a7786f97563fd7961a796b9d0f9b082094 | |
| parent | b7a82a2e449133752cca5cee2349180371999373 (diff) | |
improve check
| -rw-r--r-- | xmake/modules/detect/tools/find_windres.lua | 7 |
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 |
