Main Content

RTW.BuildInfo

Provide information for compiling and linking generated code

Description

AnRTW.BuildInfoobject contains information for compiling and linking generated code.

Creation

Description

example

buildInformation= RTW.BuildInforeturns a build information object. You can use the object to specify information for compiling and linking generated code. For example:

  • Compiler options

  • Preprocessor identifier definitions

  • Linker options

  • Source files and paths

  • Include files and paths

  • Precompiled external libraries

Properties

expand all

Name of generated code component.

Object Functions

addCompileFlags Add compiler options to build information
addDefines Add preprocessor macro definitions to build information
addIncludeFiles Add include files to build information
addIncludePaths Add include paths to build information
addLinkFlags Add link options to build information
addLinkObjects Add link objects to build information
addNonBuildFiles Add nonbuild-related files to build information
addSourceFiles Add source files to build information
addSourcePaths Add source paths to build information
addTMFTokens Add template makefile (TMF) tokens to build information
findBuildArg Find a specific build argument in build information
findIncludeFiles Find and add include (header) files to build information
getBuildArgs Get build arguments from build information
getCompileFlags Get compiler options from build information
getDefines Get preprocessor macro definitions from build information
getFullFileList Get list of files from build information
getIncludeFiles Get include files from build information
getIncludePaths Get include paths from build information
getLinkFlags Get link options from build information
getNonBuildFiles Get nonbuild-related files from build information
getSourceFiles Get source files from build information
getSourcePaths Get source paths from build information
removeSourceFiles Remove source files from build information object
setTargetProvidesMain Disable inclusion of code generator provided (generated or static)main.csource file during build
updateFilePathsAndExtensions Update files in build information with missing paths and file extensions
updateFileSeparator Update file separator character for file lists in build information

Examples

collapse all

When you build generated code, the build process stores anRTW.BuildInfoobject in thebuildInfo.matfile. To retrieve the object, from the code generation folder that contains thebuildInfo.matfile, run:

bi=load('buildInfo.mat');bi.buildInfo
ans = BuildInfo with properties: ComponentName: 'slexAircraftExample' Viewer: [] Tokens: [27×1 RTW.BuildInfoKeyValuePair] BuildArgs: [13×1 RTW.BuildInfoKeyValuePair] MakeVars: [] MakeArgs: '' TargetPreCompLibLoc: '' TargetLibSuffix: '' ModelRefs: [] SysLib: [1×1 RTW.BuildInfoModules] Maps: [1×1 struct] LinkObj: [] Options: [1×1 RTW.BuildInfoOptions] Inc: [1×1 RTW.BuildInfoModules] Src: [1×1 RTW.BuildInfoModules] Other: [1×1 RTW.BuildInfoModules] Path: [] Settings: [1×1 RTW.BuildInfoSettings] DisplayLabel: 'Build Info' Group: ''

The object contains build information.

This example shows how to create anRTW.BuildInfoobject and register source files.

Create anRTW.BuildInfoobject.

buildInfo = RTW.BuildInfo;

Register source files.

buildInfo.ComponentName ='foo1'; addSourceFiles(buildInfo,'foo1.c');

Specify the build method and create a static library.

tmf = fullfile(tmffolder,'ert_vcx64.tmf');buildResult1 = codebuild (pwd,buildInfo, tmf)

Version History

Introduced in R2006a