From e1806e88d3f161deaa89f912e7b27039810dded3 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 16 Mar 2020 23:15:35 +0800 Subject: improve to find sdcc --- xmake/modules/detect/tools/find_sdar.lua | 13 ++++++++++--- xmake/modules/detect/tools/find_sdcc.lua | 11 +++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/xmake/modules/detect/tools/find_sdar.lua b/xmake/modules/detect/tools/find_sdar.lua index 4f1ed46bc..cbc5b6b26 100644 --- a/xmake/modules/detect/tools/find_sdar.lua +++ b/xmake/modules/detect/tools/find_sdar.lua @@ -39,11 +39,18 @@ function main(opt) -- init options opt = opt or {} opt.command = opt.command or "--version" - - -- add search pathes (sdk/bin) + + -- add search pathes + local pathes = {} local bindir = get_config("bin") if bindir and os.isdir(bindir) then - opt.pathes = bindir + table.insert(pathes, bindir) + end + if is_host("windows") then + table.insert(pathes, "$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\SDCC)\\bin") + end + if #pathes > 0 then + opt.pathes = pathes end -- find program diff --git a/xmake/modules/detect/tools/find_sdcc.lua b/xmake/modules/detect/tools/find_sdcc.lua index a57a343db..8c4e96d53 100644 --- a/xmake/modules/detect/tools/find_sdcc.lua +++ b/xmake/modules/detect/tools/find_sdcc.lua @@ -40,10 +40,17 @@ function main(opt) opt = opt or {} opt.command = opt.command or "--version" - -- add search pathes (sdk/bin) + -- add search pathes + local pathes = {} local bindir = get_config("bin") if bindir and os.isdir(bindir) then - opt.pathes = bindir + table.insert(pathes, bindir) + end + if is_host("windows") then + table.insert(pathes, "$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\SDCC)\\bin") + end + if #pathes > 0 then + opt.pathes = pathes end -- find program -- cgit v1.3.1