From 2fff76e9465d60f22d905fabb9b98e666fce60ae Mon Sep 17 00:00:00 2001 From: JackLin00 <2269596773@qq.com> Date: Sat, 6 Aug 2022 21:15:04 +0800 Subject: [PATCH] [add]:add matlab package (#1373) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 成林 <5231628+JackLinXX@user.noreply.gitee.com> --- packages/m/matlab/xmake.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/m/matlab/xmake.lua diff --git a/packages/m/matlab/xmake.lua b/packages/m/matlab/xmake.lua new file mode 100644 index 000000000..6c7ff9a67 --- /dev/null +++ b/packages/m/matlab/xmake.lua @@ -0,0 +1,27 @@ +package("matlab") + set_homepage("https://www.mathworks.com/help/matlab/ref/mex.html") + set_description("Build MEX function or engine application in matlab") + on_fetch(function (package) + import("detect.sdks.find_matlab") + local matlab = find_matlab() + if matlab then + local result = {} + if package:is_plat("mingw") then + result.linkdirs = matlab.linkdirs.mingw64 + result.links = matlab.links.mingw64 + result.shflags = path.join(matlab.linkdirs.mingw64, "mexFunction.def") + result.includedirs = matlab.includedirs + elseif package:is_plat("windows") then + result.linkdirs = matlab.linkdirs.microsoft + result.links = matlab.links.microsoft + result.shflags = "/EXPORT:mexFunction" + result.includedirs = matlab.includedirs + else + wprint("Matlab MEX function do not support this platform[%s].", package:plat()) + return + end + return result + else + wprint("Can't find matlab.please check your machine.") + end + end) \ No newline at end of file