summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-13 22:48:01 +0800
committerGitHub <[email protected]>2022-09-13 22:48:01 +0800
commita30b7fc18e11401d613142342c78d958460f1e2f (patch)
treea0018e5a6345b37d7ce9d6dde23298daf4051c17
parent8f60e9b077334bf6d7cbd47f0bee2f91bad9f9c5 (diff)
parent080cd27df665e1002ecb8edc8925d4ad824e9fbf (diff)
Merge pull request #2807 from WubiCookie/matlab
Rename 'runtime_version' to 'version'
-rw-r--r--xmake/modules/detect/sdks/find_matlab.lua13
-rw-r--r--xmake/modules/detect/sdks/find_matlab_runtime.lua13
2 files changed, 14 insertions, 12 deletions
diff --git a/xmake/modules/detect/sdks/find_matlab.lua b/xmake/modules/detect/sdks/find_matlab.lua
index b8089d170..8d69f4ca0 100644
--- a/xmake/modules/detect/sdks/find_matlab.lua
+++ b/xmake/modules/detect/sdks/find_matlab.lua
@@ -33,7 +33,7 @@ import("detect.sdks.matlab")
--
function main(opt)
opt = opt or {}
- local runtime_version = opt.runtime_version and tostring(opt.runtime_version) or nil
+ local version = opt.require_version and tostring(opt.require_version) or nil
local result = {sdkdir = "", includedirs = {}, linkdirs = {}, links = {}}
if is_host("windows") then
local matlabkey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB"
@@ -43,14 +43,14 @@ function main(opt)
end
local itemkey
- if runtime_version == nil then
+ if version == nil then
itemkey = valuekeys[1] .. ";MATLABROOT"
else
- local versionname = matlab.versions()[runtime_version]
+ local versionname = matlab.versions()[version]
if versionname ~= nil then
- itemkey = matlabkey .. "\\" .. runtime_version .. ";MATLABROOT"
+ itemkey = matlabkey .. "\\" .. version .. ";MATLABROOT"
else
- local versionvalue = matlab.versions_names()[runtime_version:lower()]
+ local versionvalue = matlab.versions_names()[version:lower()]
if versionvalue ~= nil then
itemkey = matlabkey .. "\\" .. versionvalue .. ";MATLABROOT"
else
@@ -58,7 +58,7 @@ function main(opt)
for k, v in pairs(matlab.versions()) do
print(" ", k, v)
end
- raise("MATLAB Runtime version does not exist: " .. runtime_version)
+ raise("MATLAB Runtime version does not exist: " .. version)
end
end
end
@@ -86,3 +86,4 @@ function main(opt)
end
return result
end
+
diff --git a/xmake/modules/detect/sdks/find_matlab_runtime.lua b/xmake/modules/detect/sdks/find_matlab_runtime.lua
index 41f1f0efd..b7fae4888 100644
--- a/xmake/modules/detect/sdks/find_matlab_runtime.lua
+++ b/xmake/modules/detect/sdks/find_matlab_runtime.lua
@@ -33,7 +33,7 @@ import("detect.sdks.matlab")
--
function main(opt)
opt = opt or {}
- local runtime_version = opt.runtime_version and tostring(opt.runtime_version) or nil
+ local version = opt.require_version and tostring(opt.require_version) or nil
local result = {sdkdir = "", includedirs = {}, linkdirs = {}, links = {}, bindirs = {}}
if is_host("windows") then
local matlabkey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB Runtime"
@@ -45,18 +45,18 @@ function main(opt)
local itemkey
local versionname
local versionvalue
- if runtime_version == nil then
+ if version == nil then
local splitvaluekeys = valuekeys[1]:split("\\")
versionvalue = splitvaluekeys[#splitvaluekeys]
versionname = matlab.versions()[versionvalue]
itemkey = valuekeys[1] .. ";MATLABROOT"
else
- versionname = matlab.versions()[runtime_version]
+ versionname = matlab.versions()[version]
if versionname ~= nil then
versionvalue = matlab.versions_names()[versionname:lower()]
- itemkey = matlabkey .. "\\" .. runtime_version .. ";MATLABROOT"
+ itemkey = matlabkey .. "\\" .. version .. ";MATLABROOT"
else
- versionvalue = matlab.versions_names()[runtime_version:lower()]
+ versionvalue = matlab.versions_names()[version:lower()]
versionname = matlab.versions()[versionvalue]
if versionvalue ~= nil then
itemkey = matlabkey .. "\\" .. versionvalue .. ";MATLABROOT"
@@ -65,7 +65,7 @@ function main(opt)
for k, v in pairs(matlab.versions()) do
print(" ", k, v)
end
- raise("MATLAB Runtime version does not exist: " .. runtime_version)
+ raise("MATLAB Runtime version does not exist: " .. version)
end
end
end
@@ -98,3 +98,4 @@ function main(opt)
end
return result
end
+