Skip to content

Commit a8c6000

Browse files
committed
improve cosmocc for windows
1 parent 21ae0fa commit a8c6000

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tests/projects/c/cosmocc/console/xmake.lua

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ add_rules("mode.debug", "mode.release")
22

33
add_requires("cosmocc")
44

5+
-- TODO, we should add envs to toolchains/cosmocc
6+
if is_subhost("windoows") then
7+
add_requires("msys2")
8+
add_packages("msys2")
9+
end
10+
511
target("test")
612
set_kind("binary")
713
add_files("src/*.c")

xmake/core/sandbox/modules/import/lib/detect/find_program.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ end
7474

7575
-- check program
7676
function sandbox_lib_detect_find_program._check(program, opt)
77+
opt = opt or {}
7778
local findname = program
7879
if os.subhost() == "windows" then
79-
if not program:endswith(".exe") and not program:endswith(".cmd") and not program:endswith(".bat") then
80+
if not opt.shell and not program:endswith(".exe") and not program:endswith(".cmd") and not program:endswith(".bat") then
8081
findname = program .. ".exe"
8182
end
8283
elseif os.subhost() == "msys" and os.isfile(program) and os.filesize(program) < 256 then

0 commit comments

Comments
 (0)