matlab.buildtool.tasks.MexTask Class
Namespace: matlab.buildtool.tasks
Superclasses: matlab.buildtool.Task
Description
The matlab.buildtool.tasks.MexTask
class provides a build task for
compiling and linking source files into a binary MEX file. To build a MEX file, the task runs
the mex
command. You must have a supported compiler
installed on your system to run this task.
Tasks that you create with the MexTask
class support incremental builds.
For more information, see Up-To-Date Check.
Creation
Description
task = matlab.buildtool.tasks.MexTask(sourceFiles,outputFolder)
creates a task for building a MEX file, and sets the SourceFiles
and OutputFolder
properties. The task compiles and links the
specified source files into a binary MEX file and saves it to the specified output
folder.
task = matlab.buildtool.tasks.MexTask(sourceFiles,outputFolder,Name=Value)
sets the Filename
and Options
properties using one or more name-value arguments. You can
also set the Description
and Dependencies
properties, which the class inherits from the Task
class,
using name-value arguments. For example, task =
matlab.buildtool.tasks.MexTask("mymex.c","output",Options="-R2018a")
creates a
task that builds a MEX file by using the interleaved complex API
(-R2018a
).
Properties
Examples
More About
Tips
A
MexTask
instance respects the build output verbosity level specified at run time using the-verbosity
option of thebuildtool
command. The run-time verbosity level takes precedence over any value specified in theOptions
property. (since R2024b)You cannot overwrite or remove the actions of a built-in task, but you can specify additional task actions. For example, append an action to the
Actions
property of a built-in task.plan("myTask").Actions(end+1) = @myAction;
Version History
Introduced in R2024a