addLinkObjects
Add link objects to build information
Description
addLinkObjects(
specifies included files and paths to add to the build information.buildinfo
,linkobjs
,paths
,priority
,precompiled
,linkonly
,groups
)
The function requires the buildinfo
,
linkobs
, and paths
arguments. You can
optionally select priority
for link objects, select whether the
objects are precompiled
, select whether the objects are
linkonly
objects, and apply a groups
argument to group your options.
The code generator stores the included link object and path options in a build information object. The function adds options to the object based on the order in which you specify them.
Examples
Add Link Objects to Build Information
Add the linkable objects libobj1
and
libobj2
to the build information myBuildInfo
. Mark both
objects as link-only. Since individual priorities are not specified, the function adds the
objects to the vector in the order specified.
myBuildInfo = RTW.BuildInfo; addLinkObjects(myBuildInfo,{'libobj1' 'libobj2'}, ... {'/proj/lib/lib1' '/proj/lib/lib2'},1000, ... false,true);
Add Prioritized Link-Only Link Objects to Build Information
Add the linkable objects libobj1
and
libobj2
to the build information myBuildInfo
. Set the
priorities of the objects to 26 and 10, respectively. Because libobj2
is
assigned the lower numeric priority value and has the higher priority, the function orders the
objects such that libobj2
precedes libobj1
in the
vector.
myBuildInfo = RTW.BuildInfo; addLinkObjects(myBuildInfo, {'libobj1' 'libobj2'}, ... {'/proj/lib/lib1' '/proj/lib/lib2'},[26 10]);
Add Precompiled Link Objects to MyTest Group
Add the linkable objects libobj1
and
libobj2
to the build information myBuildInfo
. Set the
priorities of the objects to 26 and 10, respectively. Mark both objects as precompiled. Group
them under the name MyTest
.
myBuildInfo = RTW.BuildInfo; addLinkObjects(myBuildInfo,{'libobj1' 'libobj2'}, ... {'/proj/lib/lib1' '/proj/lib/lib2'},[26 10], ... true,false,'MyTest');
Input Arguments
buildinfo
— Build information object
object
RTW.BuildInfo
object that contains information for compiling and
linking generated code.
linkobjs
— List of linkable object files to add to build information
character vector | array of character vectors | string
You can specify the linkobjs
argument as a character vector,
as an array of character vectors, or as a string. If you specify the
linkobjs
argument as multiple character vectors, for example,
'libobj1' 'libobj2'
, the linkobjs
argument is
added to the build information as an array of character vectors.
The function removes duplicate linkable object entries with an exact match of a path and file name to a previously defined entry in the build information object.
Example: 'libobj1'
paths
— List of included file paths to add to build information
character vector | array of character vectors | string
You can specify the paths
argument as a character vector, as
an array of character vectors, or as a string. If you specify a single path as a character
vector, the function uses that path for all files. If you
specify the paths
argument as multiple character vectors, for
example, '/proj/lib/lib1'
and '/proj/lib/lib2'
, the
paths
argument is added to the build information as an array of
character vectors. The number of elements in paths
must match the
number of elements in the linkobjs
argument.
Example: '/proj/lib/lib1'
priority
— List of priority values for link objects to add to build information
1000
(default) | numeric value | array of numeric values
A numeric value or an array of numeric values that indicates the relative priority of each specified link object. Lower values have higher priority.
Example: 1000
precompiled
— List of precompiled indicators for link objects to add to build information
false (default) | true | array of logical values
A logical value or an array of logical values that indicates whether each specified link
object is precompiled. The logical value true
indicates precompiled.
Example: false
linkonly
— List of link-only indicators for link objects to add to build information
false
(default) | true
A logical value or an array of logical values that indicates whether each specified link
object is link-only (not precompiled). The logical value true
indicates
link-only. If linkonly
is true
, the value of the
precompiled
argument is ignored.
Example: false
groups
— Optional group name for the added link object files
character vector | array of character vectors | string
You can specify the groups
argument as a character vector, as
an array of character vectors, or as a string. If you specify multiple
groups
, for example, 'MyTest1' 'MyTest2'
, the
function relates the groups
to the
linkobjs
in order of appearance. For example, the
linkobjs
argument 'libobj1' 'libobj2'
is an
array of character vectors with two elements. The first element is in the
'MyTest1'
group, and the second element is in the
'MyTest2'
group.
Example: 'MyTest1' 'MyTest2'
Version History
Introduced in R2006a
See Also
Topics
- Customize Post-Code-Generation Build Processing (Simulink Coder)
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)