Main Content

setCommand

Class: coder.make.BuildTool
Package: coder.make

Set build tool command

Syntax

h.setCommand(commandvalueinput)

Description

h.setCommand(commandvalueinput) sets the value of the coder.make.BuildTool.Command property.

Input Arguments

expand all

Object handle for a coder.make.BuildTool object, specified as a variable.

Example: tool

Value of the coder.make.BuildTool.Command property. Enter a character vector, or the handle of a coder.make.BuildItem object that contains an option value.

Examples

Get a default build tool and set its properties

The intel_tc.m file from Add Custom Toolchains to MATLAB® Coder™ Build Process, uses the following lines to set the command of a default build tool, C Compiler, from a ToolchainInfo object called tc, and then sets its properties.

% ------------------------------
% C Compiler
% ------------------------------
 
tool = tc.getBuildTool('C Compiler');

tool.setName('Intel C Compiler');
tool.setCommand('icl');
tool.setPath('');

tool.setDirective('IncludeSearchPath','-I');
tool.setDirective('PreprocessorDefine','-D');
tool.setDirective('OutputFlag','-Fo');
tool.setDirective('Debug','-Zi');

tool.setFileExtension('Source','.c');
tool.setFileExtension('Header','.h');
tool.setFileExtension('Object','.obj');

tool.setCommandPattern('|>TOOL<| |>TOOL_OPTIONS<| |>OUTPUT_FLAG<||>OUTPUT<|');