addAttribute

Class: coder.make.ToolchainInfo
Package: coder.make

Add custom attribute to Attributes

Syntax

h.addAttribute(att_name, att_value)
h.addAttribute(att_name)

Description

h.addAttribute(att_name, att_value) adds a custom attribute with the specified name to coder.make.ToolchainInfo.Attributes. Use att_value to override the default attribute value, true.

h.addAttribute(att_name) adds an attribute and initializes its value to true.

All attributes are optional. You can add attributes for the toolchain to use. The following attributes are used during the build process:

  • TransformPathsWithSpaces (value = True/False) When enabled, this method looks for spaces in paths to source files, include files, include paths, additional source paths, object paths, and prebuild object paths, library paths, and within MACROS used in any of the stated paths. If any path contains spaces, an alternate version of the path is returned.  For long path names or paths with spaces, this returns the '~' version on Windows.  On UNIX platforms, paths with spaces are returned with the spaces escaped.

  • RequiresBatchFile: (value = True/False) When enabled, creates a batch file that runs the make file that is generated.

  • SupportsUNCPaths: (value = True/False) Looks in the same locations for UNC paths (Windows® only, ignored on Linux®/Mac platforms). If there is a drive mapped to the UNC the path is pointing to, then paths that are UNC paths will have a mapped drive letter put in place.

  • SupportsDoubleQuotes: (not defined or value = True) Wraps each path in double quotes if they contain spaces.

  • RequiresCommandFile: (not defined or value = True) This is used to handle long archiver/linker lines in Windows. If specified the make file replace a long object list with a call to a command file.

Input Arguments

expand all

A coder.make.ToolchainInfo object, specified using an object handle, such as h. To create h, enter h = coder.make.ToolchainInfo in a MATLAB® Command Window.

Name of attribute, specified as a character vector.

Data Types: char

Attribute value. Any data type.

Examples

Add an attribute and initialize its value, overriding the default value

h.Attribute
ans = 


# -------------------
# "Attribute" List
# -------------------
(empty)
h.addAttribute('TransformPathsWithSpaces',false)
h.getAttribute('TransformPathsWithSpaces')
ans  = 

     0

Add attribute without overriding its default value

h.addAttribute('CustomAttribute')
h.Attributes
ans = 


# -------------------
# "Attributes" List
# -------------------
CustomAttribute = true

Add attribute using toolchain definition file

The intel_tc.m file from the Adding a Custom Toolchain example defines the following custom attributes:

tc.addAttribute('TransformPathsWithSpaces');
tc.addAttribute('RequiresCommandFile');
tc.addAttribute('RequiresBatchFile');

To see the property values from that example in the MATLAB Command Window, enter:

h = intel_tc;
h.Attributes
ans = 


# -------------------
# "Attributes" List
# -------------------
RequiresBatchFile        = true
RequiresCommandFile      = true
TransformPathsWithSpaces = true

Related Examples

Was this topic helpful?