Main Content

Create and Validate ToolchainInfo Object

This example shows how to create and validate a coder.make.ToolchainInfo object from the toolchain definition file.

Before you create and validate a ToolchainInfo object, create and edit a toolchain definition file, as described in Create and Edit Toolchain Definition File.

  1. Use the function defined by the toolchain definition file to create a coder.make.ToolchainInfo object and assign the object to a handle. For example, the MATLAB® Command Window, enter:

    tc = newtoolchn_tc

  2. Use the coder.make.ToolchainInfo.validate method with the coder.make.ToolchainInfo object. For example, enter:

    tc.validate

    If the coder.make.ToolchainInfo object contains errors, the validation method displays error messages in the MATLAB Command Window.

  3. Search the toolchain definition file for items named in the error message (without quotes) and update the values.

  4. Repeat the process of creating and validating the ToolchainInfo object until there are no more errors.

Next, register the custom toolchain, as described in Register the Custom Toolchain.

For more information, see Troubleshooting Custom Toolchain Validation.