Main Content

addLinkObjects

Add link objects to model build information

Description

example

addLinkObjects(buildinfo,linkobjs,paths,priority,precompiled,linkonly,groups) specifies included files and paths to add to the build information.

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

collapse all

Add the linkable objects libobj1 and libobj2 to the build information myModelBuildInfo. Mark both objects as link-only. Since individual priorities are not specified, the function adds the objects to the vector in the order specified.

myModelBuildInfo = RTW.BuildInfo;
addLinkObjects(myModelBuildInfo,{'libobj1' 'libobj2'}, ...
   {'/proj/lib/lib1' '/proj/lib/lib2'},1000, ...
   false,true);

Add the linkable objects libobj1 and libobj2 to the build information myModelBuildInfo. 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.

myModelBuildInfo = RTW.BuildInfo;
addLinkObjects(myModelBuildInfo, {'libobj1' 'libobj2'}, ...
   {'/proj/lib/lib1' '/proj/lib/lib2'},[26 10]);

Add the linkable objects libobj1 and libobj2 to the build information myModelBuildInfo. Set the priorities of the objects to 26 and 10, respectively. Mark both objects as precompiled. Group them under the name MyTest.

myModelBuildInfo = RTW.BuildInfo;
addLinkObjects(myModelBuildInfo,{'libobj1' 'libobj2'}, ...
   {'/proj/lib/lib1' '/proj/lib/lib2'},[26 10], ...
   true,false,'MyTest');

Input Arguments

collapse all

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'

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'

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

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

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

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'

Introduced in R2006a