From 32e8ae94db5070246ec8d4dfa8c024376ff32872 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 1 Apr 2022 00:59:29 +0800 Subject: improve to find zig c++ --- xmake/core/sandbox/modules/import/lib/detect/find_program.lua | 5 +++++ 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) -- cgit v1.3.1