From f86fca0295c477587792ec8955609966790b7dcd Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 29 Feb 2024 00:48:35 +0800 Subject: improve executable_path --- xmake/modules/private/utils/executable_path.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xmake/modules/private/utils/executable_path.lua') 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 -- cgit v1.3.1