diff options
| author | charles seizilles <[email protected]> | 2022-09-06 18:51:18 +0200 |
|---|---|---|
| committer | charles seizilles <[email protected]> | 2022-09-06 18:51:18 +0200 |
| commit | 3a52c917cf4cdcb5936a505a1554758de06ec3bd (patch) | |
| tree | c8f472a1be5f85ad9346f87b4469a37959970fc6 | |
| parent | 2c84d9fdfff81222e5d1bf78f9a70e7456dbd99a (diff) | |
Fix find_matlab[_runtime]
| -rw-r--r-- | xmake/modules/detect/sdks/find_matlab.lua | 8 | ||||
| -rw-r--r-- | xmake/modules/detect/sdks/find_matlab_runtime.lua | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/xmake/modules/detect/sdks/find_matlab.lua b/xmake/modules/detect/sdks/find_matlab.lua index 1980ea960..fb2f89ca2 100644 --- a/xmake/modules/detect/sdks/find_matlab.lua +++ b/xmake/modules/detect/sdks/find_matlab.lua @@ -37,7 +37,7 @@ function main(opt) local result = {sdkdir = "", includedirs = {}, linkdirs = {}, links = {}} if is_host("windows") then - local matlabkey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB" + local matlabkey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB" local valuekeys = winos.registry_keys(matlabkey) if #valuekeys == 0 then return nil @@ -80,7 +80,11 @@ function main(opt) -- find lib for _, value in pairs(result.linkdirs) do local dirbasename = path.basename(value) - result.links[dirbasename] = path.join(value, "*") + result.links[dirbasename] = {} + for __, filepath in ipairs(os.files(value.."/*.lib")) do + table.insert(result.links[dirbasename], path.basename(filepath)) + end + result.links[dirbasename] = table.unique(result.links[dirbasename]) end end return result diff --git a/xmake/modules/detect/sdks/find_matlab_runtime.lua b/xmake/modules/detect/sdks/find_matlab_runtime.lua index 27852d2f0..255ac1825 100644 --- a/xmake/modules/detect/sdks/find_matlab_runtime.lua +++ b/xmake/modules/detect/sdks/find_matlab_runtime.lua @@ -49,7 +49,7 @@ function main(opt) local itemkey = nil if runtime_version == nil then local splitvaluekeys = valuekeys[1]:split("\\") - versionvalue = splitvaluekeys[#splitvaluekeys - 1] + versionvalue = splitvaluekeys[#splitvaluekeys] versionname = matlab.versions()[versionvalue] itemkey = valuekeys[1] .. ";MATLABROOT" else @@ -95,7 +95,11 @@ function main(opt) -- find lib for _, value in pairs(result.linkdirs) do local dirbasename = path.basename(value) - result.links[dirbasename] = path.join(value, "*") + result.links[dirbasename] = {} + for __, filepath in ipairs(os.files(value.."/*.lib")) do + table.insert(result.links[dirbasename], path.basename(filepath)) + end + result.links[dirbasename] = table.unique(result.links[dirbasename]) end end return result |
