summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/sdks/find_matlab.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-07 22:47:24 +0800
committerruki <[email protected]>2022-09-07 22:47:24 +0800
commitff4ac252b4aedd535c2c7112c6078f66bb854635 (patch)
tree5b25af86e9e9fafefbf77eec1a494d65c5d87a87 /xmake/modules/detect/sdks/find_matlab.lua
parentf16528f0e60e1823fc1aa093e5cd38f8e3406ac9 (diff)
format code
Diffstat (limited to 'xmake/modules/detect/sdks/find_matlab.lua')
-rw-r--r--xmake/modules/detect/sdks/find_matlab.lua9
1 files changed, 3 insertions, 6 deletions
diff --git a/xmake/modules/detect/sdks/find_matlab.lua b/xmake/modules/detect/sdks/find_matlab.lua
index e6adbde0b..b8089d170 100644
--- a/xmake/modules/detect/sdks/find_matlab.lua
+++ b/xmake/modules/detect/sdks/find_matlab.lua
@@ -34,16 +34,15 @@ import("detect.sdks.matlab")
function main(opt)
opt = opt or {}
local runtime_version = opt.runtime_version and tostring(opt.runtime_version) or nil
-
local result = {sdkdir = "", includedirs = {}, linkdirs = {}, links = {}}
if is_host("windows") then
local matlabkey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB"
local valuekeys = winos.registry_keys(matlabkey)
if #valuekeys == 0 then
- return nil
+ return
end
- local itemkey = nil
+ local itemkey
if runtime_version == nil then
itemkey = valuekeys[1] .. ";MATLABROOT"
else
@@ -66,18 +65,16 @@ function main(opt)
local sdkdir = try {function () return winos.registry_query(itemkey) end}
if not sdkdir then
- return nil
+ return
end
result.sdkdir = sdkdir
result.includedirs = path.join(sdkdir, "extern", "include")
- -- find lib dirs
for _, value in ipairs(os.dirs(path.join(sdkdir, "extern", "lib", "**"))) do
local dirbasename = path.basename(value)
if not dirbasename:startswith("win") then
result.linkdirs[dirbasename] = value
end
end
- -- find lib
for _, value in pairs(result.linkdirs) do
local dirbasename = path.basename(value)
result.links[dirbasename] = {}