Main Content

setDirective

Class: target.BuildTool
Namespace: target

Set directive values

Since R2023a

Syntax

myBuildTool.setDirective(directiveName,directiveValue)
myBuildTool.setDirective(pairedDirectiveName,startValue,endValue)

Description

myBuildTool.setDirective(directiveName,directiveValue) sets the named directive to the specified value.

myBuildTool.setDirective(pairedDirectiveName,startValue,endValue) sets the start and end values of the named directive.

If the Directives property does not contain the directive, the method appends a new object of the appropriate subclass of target.BaseDirective.

If the directive name is not supported by the build tool type specified by the target.BuildToolType object, the method produces an error.

Input Arguments

expand all

Name of directive.

Example: cCompiler.setDirective('CommandFile', '@');

New value for named directive.

Example: cCompiler.setDirective('CommandFile', '@');

Name of directive that contains a pair of command-line flags.

Example: cLinker.setDirective('LibraryGroup', '-Wl,--start-group', '-Wl,--end-group');

New start value for paired directive.

Example: cLinker.setDirective('LibraryGroup', '-Wl,--start-group', '-Wl,--end-group');

New end value for paired directive.

Example: cLinker.setDirective('LibraryGroup', '-Wl,--start-group', '-Wl,--end-group');

Examples

For an example that uses this method, see Define GCC-Based Toolchain for Windows Development Computer.

Version History

Introduced in R2023a