diff options
| author | ruki <[email protected]> | 2022-04-01 00:59:29 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-04-01 00:59:29 +0800 |
| commit | 32e8ae94db5070246ec8d4dfa8c024376ff32872 (patch) | |
| tree | 0e55d6d50d5038df7933604d31c4fa2ae485dadb | |
| parent | 064a55f2639510ef34e967ce64589531bab1afc6 (diff) | |
improve to find zig c++
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_program.lua | 5 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/find_zig_cxx.lua | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua index 59a01f746..90dd963fb 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua @@ -87,6 +87,11 @@ function sandbox_lib_detect_find_program._check(program, opt) end if sandbox_lib_detect_find_program._do_check(findname, opt) then return program + -- check "zig c++" without ".exe" + -- https://github.com/xmake-io/xmake/issues/2232 + elseif findname ~= program and path.filename(program):find(" ", 1, true) and + sandbox_lib_detect_find_program._do_check(program, opt) then + return program end end diff --git a/xmake/modules/detect/tools/find_zig_cxx.lua b/xmake/modules/detect/tools/find_zig_cxx.lua index d9e63e7de..9864df069 100644 --- a/xmake/modules/detect/tools/find_zig_cxx.lua +++ b/xmake/modules/detect/tools/find_zig_cxx.lua @@ -36,14 +36,8 @@ import("lib.detect.find_programver") -- @endcode -- function main(opt) - - -- init options opt = opt or {} - - -- find program local program = find_program(opt.program or "zig c++", opt) - - -- find program version local version = nil if program and opt.version then version = find_programver(program, opt) |
