summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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