Contenido principal

setFileExtensions

Class: target.BuildTool
Namespace: target

Set file extensions

Since R2023a

Syntax

myBuildTool.setFileExtensions(fileTypeName,extensionValues)

Description

myBuildTool.setFileExtensions(fileTypeName,extensionValues) sets the file extensions for the named file type to the specified value.

If the FileExtensions property does not contain the corresponding target.FileExtensionSet object, the method appends a new object.

If the file type name is not listed in the target.BuildToolType object, the method produces an error.

Input Arguments

expand all

Name of file type.

Example: cCompiler.setFileExtensions('Source', '.cx');

New value for file extensions.

Example: cCompiler.setFileExtensions('Header', {'.hx'});

Examples

expand all

This code snippet shows you can use the setFileExtensions method to specify a C compiler that generates object files with the .obj extension.

cCompiler = target.create('BuildTool', 'C Compiler', 'gcc', ...
    'Name', 'MinGW GCC C Compiler');
cCompiler.setDirective('CommandFile', '@');
cCompiler.setFileExtensions('Object', {'.obj'});

Version History

Introduced in R2023a