cmaize.toolchain/toolchain

cmaize.toolchain/toolchain._CMAIZE_TOOLCHAIN_AUTOPOPULATED_VARIABLE_NAMES

Variables that CMaize will autopopulate in its Toolchain object. This variable is a list of strings representing variable names.

Default value:

Type:

str

class cmaize.toolchain/toolchain.Toolchain

The Toolchain class is a source code representation of the toolchain file that can be provided by users to specify options sent to every dependency.

Users need a way to specify options which should be passed to every dependency. By convention this is done by setting the options in a toolchain file. The Toolchain class is the source code representation of this file, containing values autopopulated by CMaize, as well as user-specified options. User options take precidence over autopopulated values.

Additional Constructors

CTOR()

Default constructor for Toolchain object with only autopopulated options available.

Parameters:

self (Toolchain) – Toolchain object constructed.

Returns:

self will be set to the newly constructed Toolchain object.

Return type:

Toolchain

CTOR(toolchain_path)

Constructor for Toolchain object with a path to a toolchain file.

Parameters:
  • self (Toolchain) – Toolchain object constructed.

  • toolchain_path (path) – Path to the toolchain file to load.

Returns:

self will be set to the newly constructed Toolchain object.

Return type:

Toolchain

CTOR(file_contents)

Constructor for Toolchain object with a string assumed to be the contents of an already opened toolchain file.

Parameters:
  • self (Toolchain) – Toolchain object constructed.

  • file_contents (str) – Contents of the toolchain file.

Returns:

self will be set to the newly constructed Toolchain object.

Return type:

Toolchain

Methods

generate_file_contents(return_value)

Generate the contents of a toolchain file.

Generates a string with valid toolchain file contents based on the state of the toolchain object. The generated contents will contain the autopopulated options first, followed by the user-specified toolchain file, verbatim. By putting the user-specified toolchain file after the autopopulated options, the user-specified options will override any autopopulated options.

If you need to write the toolchain contents to a file, use the write_file member function instead of generate_file_contents.

Parameters:
  • self (Toolchain) – Toolchain object to generate toolchain file from.

  • return_value (str) – Return value with toolchain file contents.

Returns:

Toolchain file content string.

Return type:

str

write_toolchain(toolchain_path)

Writes the toolchain object contents to a toolchain file.

If the contents of this toolchain file are needed, they can be generated directly with the generate_file_contents member function.

Parameters:
  • self (Toolchain) – Toolchain object to create toolchain file from.

  • toolchain_path (path) – Location to write toolchain file. This should include the toolchain file name as well.

_autopopulate_options()

Autopopulates certain toolchain variables as default values to be used if not specified by the user toolchain file.

Parameters:

self (Toolchain) – Toolchain object to autopopulate.

__initialize()

Initialize empty option maps of the Toolchain object and autopopulates some options.

Parameters:

self (Toolchain) – Toolchain object to initialize.

Attributes

auto_options
encoded_toolchain_contents