Main Content

target.Toolchain class

Package: target

Capture high-level information about toolchain

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.

Properties

expand all

An object that describes the configuration of a build automation tool.

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.

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.

Attributes:

GetAccess
public
SetAccess
public

Development computer operating systems that the toolchain can run on.

Attributes:

GetAccess
public
SetAccess
public

Tools in the toolchain.

Attributes:

GetAccess
public
SetAccess
public

Optional. Target devices for which the toolchain can build code.

Attributes:

GetAccess
public
SetAccess
public

Name of the toolchain, in a form that you want workflows to display.

Example: 'CMake/Ninja for all hosts'

Attributes:

GetAccess
public
SetAccess
public

Examples

collapse all

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 = fullfile(pwd, 'ExampleCMakeToolchain.cmake');

Version History

Introduced in R2022b