addLinkObjects - Add link objects to model's build information

Syntax

addLinkObjects(buildinfo, linkobjs, paths, priority, precompiled, linkonly, groups)

All arguments except buildinfo , linkobjs, and paths are optional. If you specify an optional argument, you must specify all of the optional arguments preceding it.

Arguments

buildinfo

Build information returned by RTW.BuildInfo.

linkobjs

A character array or cell array of character arrays that specifies the filenames of linkable objects to be added to the build information. The function adds the filenames that you specify in the function call to a vector that stores the object filenames in priority order. If you specify multiple objects that have the same priority (see priority below), the function adds them to the vector based on the order in which you specify the object filenames in the cell array.

The function removes duplicate link objects that

A duplicate entry consists of an exact match of a path string and corresponding linkable object filename.

paths

A character array or cell array of character arrays that specifies paths to the linkable objects. If you specify a character array, the path string applies to all linkable objects.

priority (optional)

A numeric value or vector of numeric values that indicates the relative priority of each specified link object. Lower values have higher priority. The default priority is 1000.

precompiled (optional)

The logical value true or false or a vector of logical values that indicates whether each specified link object is precompiled.

linkonly (optional)

The logical value true or false or a vector of logical values that indicates whether each specified link object is to be only linked. If you set this argument to false, the function also adds a rule to the makefile for building the objects.

groups (optional)

A character array or cell array of character arrays that groups specified link objects. You can use groups to

You can apply

To...Specify groups a...
Apply one group name to all link objectsCharacter array.
Apply different group names to link objectsCell array of character arrays such that the number of group names matches the number elements you specify for linkobjs.

Description

The addLinkObjects function adds specified link objects to the model's build information. The Real-Time Workshop® software stores the link objects in a vector in relative priority order. If multiple objects have the same priority or you do not specify priorities, the function adds the objects to the vector based on the order in which you specify them.

In addition to the required buildinfo, linkobjs, and paths arguments, you can specify the optional arguments priority, precompiled, linkonly, and groups. You can specify paths and groups as a character array or a cell array of character arrays.

If You Specify paths or groups as a... The Function...
Character arrayApplies the character array to all objects it adds to the build information.
Cell array of character arraysPairs each character array with a specified object. Thus, the length of the cell array must match the length of the cell array you specify for linkobjs.

Similarly, you can specify priority, precompiled, and linkonly as a value or vector of values.

If You Specify priority, precompiled, or linkonly as a... The Function...
ValueApplies the value to all objects it adds to the build information.
Vector of valuesPairs each value with a specified object. Thus, the length of the vector must match the length of the cell array you specify for linkobjs.

If you choose to specify an optional argument, you must specify all of the optional arguments preceding it. For example, to specify that all objects are precompiled using the precompiled argument, you must specify the priority argument that precedes precompiled. You could pass the default priority value 1000, as shown below.

addLinkObjects(myBuildInfo, 'test1', '/proj/lib/lib1', 1000, true);

Examples

See Also

Programming a Post Code Generation Command

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS