craftr.ext.compiler

This module provides common utility functions that are used by compiler interface implementations, for example to convert source filenames to object filenames using gen_objects().

Submodules:
craftr.ext.compiler.detect_compiler(program, language)

Detects the compiler interface based on the specified program assuming it is used for the specified language. Returns the detected compiler or raises ToolDetectionError. Supports all available compiler toolset implementations.

craftr.ext.compiler.gen_output_dir(output_dir)

Given an output directory that is a relative path, it will be prefixed with the current modules’ project name. An absolute path is left unchanged. If None is given, the current working directory is returned.

craftr.ext.compiler.gen_output(output, output_dir='', suffix=None)
craftr.ext.compiler.gen_objects(sources, output_dir='obj', suffix=None)
class craftr.ext.compiler.BaseCompiler(**kwargs)

Base class for implementing a compiler object that can be forked with new options and that makes it easy to implement rule methods.

builder(inputs, frameworks, kwargs, **_add_kwargs)

Creates a TargetBuilder that also contains the frameworks of this compiler object.

fork(**kwargs)

Create a fork of the compiler while overriding the kwargs.

exception craftr.ext.compiler.ToolDetectionError

This exception is raised if a command-line tool could not be successfully be detected.