diff options
| author | ruki <[email protected]> | 2024-02-05 23:55:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-02-05 23:55:44 +0800 |
| commit | 832fc8ded7cbe98ab0244b6975d45215615221b0 (patch) | |
| tree | 2bed692dbc0b7951db841a6aec11ca1622eb72bf | |
| parent | 7da1f4565975341780560026fe0e28a51091ce70 (diff) | |
improve to find cosmocc
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_program.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/find_cosmocc.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/find_cosmocxx.lua | 1 |
3 files changed, 5 insertions, 3 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 6b8aeb13a..baa180b4b 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua @@ -47,7 +47,7 @@ function sandbox_lib_detect_find_program._do_check(program, opt) -- no check script? attempt to run it directly if not opt.check then - local ok, errors = os.runv(program, {"--version"}, {envs = opt.envs}) + local ok, errors = os.runv(program, {"--version"}, {envs = opt.envs, shell = opt.shell}) if not ok and option.get("verbose") and option.get("diagnosis") then utils.cprint("${color.warning}checkinfo: ${clear dim}" .. errors) end @@ -58,9 +58,9 @@ function sandbox_lib_detect_find_program._do_check(program, opt) local ok = false local errors = nil if type(opt.check) == "string" then - ok, errors = os.runv(program, {opt.check}, {envs = opt.envs}) + ok, errors = os.runv(program, {opt.check}, {envs = opt.envs, shell = opt.shell}) elseif type(opt.check) == "table" then - ok, errors = os.runv(program, opt.check, {envs = opt.envs}) + ok, errors = os.runv(program, opt.check, {envs = opt.envs, shell = opt.shell}) else ok, errors = sandbox.load(opt.check, program) end diff --git a/xmake/modules/detect/tools/find_cosmocc.lua b/xmake/modules/detect/tools/find_cosmocc.lua index b89244994..be7c873f8 100644 --- a/xmake/modules/detect/tools/find_cosmocc.lua +++ b/xmake/modules/detect/tools/find_cosmocc.lua @@ -36,6 +36,7 @@ import("lib.detect.find_programver") -- function main(opt) opt = opt or {} + opt.shell = true local program = find_program(opt.program or "cosmocc", opt) local version = nil if program and opt and opt.version then diff --git a/xmake/modules/detect/tools/find_cosmocxx.lua b/xmake/modules/detect/tools/find_cosmocxx.lua index c9a06fb0d..535cea6ab 100644 --- a/xmake/modules/detect/tools/find_cosmocxx.lua +++ b/xmake/modules/detect/tools/find_cosmocxx.lua @@ -36,6 +36,7 @@ import("lib.detect.find_programver") -- function main(opt) opt = opt or {} + opt.shell = true local program = find_program(opt.program or "cosmoc++", opt) local version = nil if program and opt and opt.version then |
