Main Content

setCompilerOptionMap

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

Set C/C++ language standard and compiler options for selected build tool (compiler)

Syntax

h.setCompilerOptionMap(std,opts);

Description

h.setCompilerOptionMap(std,opts); sets the C/C++ language standard and corresponding compiler options of a specific coder.make.BuildTool object in coder.make.ToolchainInfo.BuildTools.

Input Arguments

expand all

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

Example: tool

The C/C++ language standard for the compiler in the BuildTool definition, specified as a character vector.

Use one of the following for the std value:

  • 'C89/C90 (ANSI)'

  • 'C99 (ISO)'

  • 'C++03 (ISO)'

Data Types: char

The compiler options correspond to specific BuildTool name and C/C++ language standard selections, specified as a character vector. The table provides example value combinations for an Intel toolchain.

Build Tool Name (Compiler)

std Value

opts Value

'Intel C Compiler'

'C99 (ISO)'

'/Qstd=c99' for Windows®

'-std=c99' for UNIX®

'Intel C++ Compiler'

'C++03 (ISO)'

'/Qstd=c++0x' for Windows

'-std=c++0x' for UNIX

For more Intel-related options, visit https://software.intel.com/en-us/articles/iso-iec-standards-language-conformance-for-intel-c-compiler:

Data Types: char

Examples

The following version of the intel_tc.m file differs from the Add Custom Toolchains to MATLAB® Coder™ Build Process example. This example shows how to define the C_STANDARD_OPTS and CPP_STANDARD_OPTS macros, set values for the macros with the setCompilerOptionMap method, and apply the macros in build configurations.

 Define C/C++ STANDARD_OPTS Macros