diff options
| -rw-r--r-- | tests/projects/c/cosmocc/console/xmake.lua | 6 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_program.lua | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/projects/c/cosmocc/console/xmake.lua b/tests/projects/c/cosmocc/console/xmake.lua index babd520a2..1327045c1 100644 --- a/tests/projects/c/cosmocc/console/xmake.lua +++ b/tests/projects/c/cosmocc/console/xmake.lua @@ -2,6 +2,12 @@ add_rules("mode.debug", "mode.release") add_requires("cosmocc") +-- TODO, we should add envs to toolchains/cosmocc +if is_subhost("windoows") then + add_requires("msys2") + add_packages("msys2") +end + target("test") set_kind("binary") add_files("src/*.c") 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 3923916d9..3b20eb938 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua @@ -74,9 +74,10 @@ end -- check program function sandbox_lib_detect_find_program._check(program, opt) + opt = opt or {} local findname = program if os.subhost() == "windows" then - if not program:endswith(".exe") and not program:endswith(".cmd") and not program:endswith(".bat") then + if not opt.shell and not program:endswith(".exe") and not program:endswith(".cmd") and not program:endswith(".bat") then findname = program .. ".exe" end elseif os.subhost() == "msys" and os.isfile(program) and os.filesize(program) < 256 then |
