summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-01-28 17:31:09 +0300
committerSaikari <[email protected]>2026-01-28 17:31:09 +0300
commit3770cbb70e047eb40c94960480857507e8624fe9 (patch)
treee365367a21f0d8aced32fdb0f7d043e4bf25506a
parentc1a0fd840c94e54aab5317bd65b5e2f4dbca947d (diff)
Enhance os.isexec function to support Windows executable checks
-rw-r--r--xmake/core/base/os.lua13
1 files changed, 12 insertions, 1 deletions
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