fab.tools.tool_with_flags#

This file contains the base class for a tool with flags. It is the base class for compiler, linker, and pre-processor.

Classes

ToolWithFlags(name, exec_name, category[, ...])

This is the base class for all tools that provide flags.

class fab.tools.tool_with_flags.ToolWithFlags(name, exec_name, category, availability_option=None)#

This is the base class for all tools that provide flags. Note that the run method of the Tool base class is not overwritten to provide the flags to the base class, that needs to be done by the individual derived tools.

Parameters:
  • name (str) – name of the tool.

  • exec_name (str | Path) – name or full path of the executable to start.

  • category (Category) – the Category to which this tool belongs.

  • availability_option (str | List[str] | None) – a command line option for the tool to test if the tool is available on the current system. Defaults to –version. (default: None)

property flags: ProfileFlags#
Returns:

the profile flags for this tool.

get_flags(config=None, file_path=None)#
Return type:

List[str]

Returns:

the flags to be used with this tool.

add_flags(new_flags, profile=None)#

Adds the specified flags to the list of flags.

Parameters:

new_flags (AbstractFlags | str | List[str]) – A single string or list of strings which are the flags to be added.

define_profile(name, inherit_from=None)#

Defines a new profile name, and allows to specify if this new profile inherit settings from an existing profile.

Parameters:
  • name (str) – Name of the profile to define.

  • inherit_from (str | None) – Optional name of a profile to inherit settings from. (default: None)