From 3770cbb70e047eb40c94960480857507e8624fe9 Mon Sep 17 00:00:00 2001 From: Saikari Date: Wed, 28 Jan 2026 17:31:09 +0300 Subject: Enhance os.isexec function to support Windows executable checks --- xmake/core/base/os.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index a752b7a42..8a9cde4cd 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -1156,7 +1156,18 @@ function os.isexec(filepath) -- check executable program exist if os.isfile(filepath) then - return os._access(filepath, "x") + if os.host() == "windows" then + return true + else + return os._access(filepath, "x") + end + end + if os.host() == "windows" then + for _, suffix in ipairs({".exe", ".cmd", ".bat"}) do + if os.isfile(filepath .. suffix) then + return true + end + end end return false end -- cgit v1.3.1