target.Toolchain Class
Namespace: target
Description
Use a target.Toolchain
object to capture high-level information about a
toolchain.
To create a target.Toolchain
object, use the target.create
function. Create the object in a single
step.
toolchainObject = target.create('Toolchain', ... nameOfToolchain, ... parameterXName, parameterXValue, ... parameterYName, parameterYValue, ... parameterZName, parameterZValue)
nameOfToolchain
is the name of the target.Toolchain
object that you want to create.
parameterXName
is the name of either a property or a referenced
object property –– see tables below.Properties
Unique ID of object in internal database.
Attributes:
GetAccess | public |
SetAccess | private |
Name of the toolchain, in a form that you want workflows to display.
Example: 'CMake/Ninja for all
hosts'
Attributes:
GetAccess | public |
SetAccess | public |
Optional. Target devices for which the toolchain can build code.
Attributes:
GetAccess | public |
SetAccess | public |
Development computer operating systems that the toolchain can run on.
Attributes:
GetAccess | public |
SetAccess | public |
Tools in the toolchain.
If you use name-value arguments to create a target.Toolchain
object, for the Tools
property, specify these
arguments.
Name | Description |
---|---|
'Family' | Provides an initial list of tools through a default set of
Example: |
'Assembler' | Optional. In the list of tools, specify the assembler through a
Example: |
'CCompiler' | Optional. In the list of tools, specify the C compiler through a
Example: |
'CppCompiler' | Optional. In the list of tools, specify the C++ compiler through
a
Example: |
'Linker' | Optional. In the list of tools, specify the linker through a
Example: |
'CppLinker' | Optional. In the list of tools, specify the C++ linker through a
Example: |
'Archiver' | Optional. In the list of tools, specify the archiver through a
Example: |
'MakeTool' | Optional. In the list of tools, specify the
Example: |
'CommandFile' | Optional. For each tool that supports a command file directive,
specify the directive through the corresponding
Example: |
'ObjectExtension' | Optional. Specify the file extension that the tools
( Example: |
'ExecutableExtension' | Optional. Specify the file extension that the tools
( Example: |
'SharedLibraryExtension' | Optional. Specify the file extension that the tools
( Example: |
'StaticLibraryExtension' | Optional. Specify the file extension that the tools
( Example: |
'FileSep' | Optional. Specify the file separator that the tools
( Example:
|
'ToolPrefix' | Optional when Example: |
Attributes:
GetAccess | public |
SetAccess | public |
An object that describes the configuration of a build automation tool. For a
CMake-based toolchain, use a target.CMakeBuilder
object. For a
makefile-based toolchain, use a target.MakefileBuilder
object.
If you use name-value arguments to create a target.Toolchain
object, for the Builder
property, specify this
argument.
Name | Description |
---|---|
'MakeToolType' | Required. Example: |
'Generator' | Optional. Example:
|
'ToolchainFile' | Optional. Example:
|
Attributes:
GetAccess | public |
SetAccess | public |
C and C++ build dependencies that you must associate with the toolchain. For example, specific preprocessor directives or libraries. When you specify this property, every build that uses the toolchain includes the dependencies.
If you use name-value arguments to create a target.Toolchain
object, for the BuildRequirements
property, specify these
arguments.
Name | Description |
---|---|
'SharedLibraries' | Optional. Example:
|
'CompilerFlags' | Optional. Example:
|
'LinkerFlags' | Optional. Example:
|
Attributes:
GetAccess | public |
SetAccess | public |
An array of objects that provide system environment setup commands and paths that are required for the use of the toolchain. For example, vendor-supplied setup scripts. Use only one object for each operating system of a development computer.
If you use name-value arguments to create a target.Toolchain
object, for the EnvironmentConfiguration
property, specify this
argument.
Name | Description |
---|---|
'SystemPaths' | Optional. Example: |
Attributes:
GetAccess | public |
SetAccess | public |
Context to perform the build, specified as an empty
target.ExecutionContext
array (default) or a
target.SSHExecutionContext
object.
Context to Build | Property Value | Specified By Example |
---|---|---|
Over SSH Connection |
target.SSHExecutionContext object |
toolChainObj.RunsOn = target.ExecutionContext.SSH(); |
Locally (default) | Empty target.ExecutionContext array |
toolChainObj.RunsOn = target.ExecutionContext.empty; |
Attributes:
GetAccess | public |
SetAccess | public |
Examples
This code snippet from Create Custom CMake Toolchain Definition shows
how you can create a target.Toolchain
object and use it to configure
the way CMake builds generated code.
tc = target.create('Toolchain', 'Name', 'Example Custom CMake Toolchain'); tc.Builder = target.create('CMakeBuilder'); tc.Builder.Generator = 'Ninja'; tc.Builder.ToolchainFile = 'pathTo/ExampleCMakeToolchain.cmake';
Or, create the object in a single step.
tc = target.create('Toolchain', ... 'Name', 'Example Custom CMake Toolchain', ... 'MakeToolType', 'CMake', ... 'Generator', 'Ninja', ... 'ToolchainFile', 'pathTo/ExampleCMakeToolchain.cmake')
This command creates an object for a GNU®-based toolchain by using several name-value arguments.
mingwtc = target.create('Toolchain', ... 'MakeToolType', 'GMake', ... 'Name', 'ARM Toolchain', ... 'SystemPaths', {'$(ARM_TOOLS_LOCATION)/bin'}, ... 'CCompiler', 'arm-none-eabi-gcc', ... 'CppCompiler', 'arm-none-eabi-g++', ... 'Linker', 'arm-none-eabi-gcc', ... 'CppLinker', 'arm-none-eabi-g++', ... 'CompilerFlags', {'-fwrapv', '-fPIC'});
Using the Family
and ToolPrefix
name-value
arguments, you can create the same
object.
target.create('Toolchain', ... 'Family', 'GNU', ... 'Name', 'ARM Toolchain', ... 'ToolPrefix', 'arm-none-eabi-');
To capture information about a more customized toolchain, you can use additional name-value arguments. For example:
target.create('Toolchain', ... 'Family', 'GNU', ... 'Name', 'ARM Toolchain', ... 'ToolPrefix', 'arm-none-eabi-', ... 'SystemPaths', {'$(ARM_TOOLS_LOCATION)/bin'}, ... 'CompilerFlags', {'-fwrapv', '-fPIC'});;
Version History
Introduced in R2022b
See Also
target.BuildTool
| target.BuildToolType
| target.CMake
| target.CMakeBuildType
| target.CMakeBuilder
| target.CMakeCacheEntry
| target.Directive
| target.EnvironmentConfiguration
| target.FileType
| target.HardwareComponentSupport
| target.MakefileBuilder
| target.MakeToolType
| target.PairedDirective
| target.RepeatingDirective
| target.create
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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)