Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop   

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

  • You specify as input

  • Already exist in the linkable object filename vector

  • Have a path that matches the path of a matching linkable object filename

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.

Specify true if the link object has been prebuilt for faster compiling and linking and exists in a specified location.

If precompiled is false (the default), the Real-Time Workshop build process creates the link object in the build directory.

This argument is ignored if linkonly equals true.

linkonly (optional)

The logical value true or false or a vector of logical values that indicates whether each specified link object is to be used only for linking.

Specify true if the Real-Time Workshop build process should not build, nor generate rules in the makefile for building, the specified link object, but should include it when linking the final executable. For example, you can use this to incorporate link objects for which source files are not available. If linkonly is true, the value of precompiled is ignored.

If linkonly is false (the default), rules for building the link objects are added to the makefile. In this case, the value of precompiled determines which subsection of the added rules is expanded, START_PRECOMP_LIBRARIES (true) or START_EXPAND_LIBRARIES (false).

groups (optional)

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

  • Document the use of specific link objects

  • Retrieve or apply groups of link objects

You can apply

  • A single group name to a linkable object

  • A single group name to multiple linkable objects

  • Multiple group name to collections of multiple linkable objects

To...Specify groups as 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.

The default value of groups is {''}.

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

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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