summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-17 00:42:39 +0800
committerruki <[email protected]>2025-09-17 00:42:39 +0800
commit54bc2d2a3f07b875bafa4437c8b7138eed8641a7 (patch)
tree624b735ef14ffaee7a212b4f20e3012e607487b4
parentd4da0944ead398d2e7eba985928adeba197557b7 (diff)
improve find_program
-rw-r--r--xmake/core/sandbox/modules/import/lib/detect/find_program.lua5
1 files changed, 5 insertions, 0 deletions
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 68fbc59ae..e1379bf44 100644
--- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
+++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
@@ -178,6 +178,11 @@ end
-- find program
function sandbox_lib_detect_find_program._find(name, paths, opt)
+ -- valid program file?
+ if path.is_absolute(name) and os.isfile(name) then
+ return name
+ end
+
-- attempt to find it from the given directories
local program_path = sandbox_lib_detect_find_program._find_from_paths(name, paths, opt)
if program_path and opt.system ~= false then