fab.steps.link module¶
Link an executable.
- class fab.steps.link.DefaultLinkerSource¶
Bases:
ArtefactsGetter
A source getter specifically for linking. Looks for the default output from archiving objects, falls back to default compiler output. This allows a link step to work with or without a preceding object archive step.
- fab.steps.link.call_linker(linker, flags, filename, objects)¶
- fab.steps.link.link_exe(config, linker=None, flags=None, source=None)¶
Link object files into an executable for every build target.
Expects one or more build targets from its artefact getter, of the form Dict[name, object_files].
The default artefact getter,
DefaultLinkerSource
, looks for any output from anArchiveObjects
step, and falls back to using output from compiler steps.- Parameters:
config – The
fab.build_config.BuildConfig
object where we can read settings such as the project workspace folder or the multiprocessing flag.flags – (default:
None
) A list of flags to pass to the linker.source (
Optional
[ArtefactsGetter
]) – (default:None
) An optionalArtefactsGetter
. Typically not required, as there is a sensible default.
Produce a shared object (.so) file from the given build target.
Expects a single build target from its artefact getter, of the form Dict[None, object_files]. We can assume the list of object files is the entire project source, compiled.
Params are as for
LinkerBase
, with the addition of:- Parameters:
config – The
fab.build_config.BuildConfig
object where we can read settings such as the project workspace folder or the multiprocessing flag.output_fpath (
str
) – File path of the shared object to create.flags – (default:
None
) A list of flags to pass to the linker.source (
Optional
[ArtefactsGetter
]) – (default:None
) An optionalArtefactsGetter
. Typically not required, as there is a sensible default.