summaryrefslogtreecommitdiff
path: root/xmake/modules/private/utils/executable_path.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/private/utils/executable_path.lua')
-rw-r--r--xmake/modules/private/utils/executable_path.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/modules/private/utils/executable_path.lua b/xmake/modules/private/utils/executable_path.lua
index f410d9a00..b79927277 100644
--- a/xmake/modules/private/utils/executable_path.lua
+++ b/xmake/modules/private/utils/executable_path.lua
@@ -50,6 +50,14 @@ function main(program)
end
end
end
+ -- patch .exe
+ -- @see https://github.com/xmake-io/xmake/discussions/4781
+ if is_host("windows") and path.is_absolute(program) then
+ local program_exe = program .. ".exe"
+ if os.isfile(program_exe) then
+ program = program_exe
+ end
+ end
if not filepath then
filepath = program
end