summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-03-16 23:15:35 +0800
committerruki <[email protected]>2020-03-16 13:33:35 +0800
commite1806e88d3f161deaa89f912e7b27039810dded3 (patch)
treeb4b707833f8a6b922ec67f4bdb2832b62cc8578e
parent719791f7eb2ebecf84ce2a182259b83219b5b773 (diff)
improve to find sdcc
-rw-r--r--xmake/modules/detect/tools/find_sdar.lua13
-rw-r--r--xmake/modules/detect/tools/find_sdcc.lua11
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