yambs.environment package#

Submodules#

yambs.environment.native module#

A module implementing a native-build environment.

class yambs.environment.native.NativeBuildEnvironment(config: Native)[source]#

Bases: LoggerMixin

A class implementing a native-build environment.

generate(sources_only: bool = False) None[source]#

Generate ninja files.

render(root: Path, name: str) None[source]#

Render a template.

write_app_rules(stream: TextIO, outputs: Set[Path], uf2_family: str = None, wasm: bool = False) Dict[Path, Path][source]#

Write app rules.

write_compile_line(stream: TextIO, path: Path, wasm: bool = False) Path[source]#

Write a single source-compile line.

write_source_rules(stream: TextIO, wasm: bool = False) Set[Path][source]#

Write source rules.

write_static_library_rule(stream: TextIO, outputs: Set[Path]) Path[source]#

Create a rule for a static library output.

write_third_party_line(stream: TextIO, path: Path, wasm: bool = False) Path | None[source]#

Write a single source-compile line for a third-party source.

Module contents#

A module implementing a build environment state manager.

class yambs.environment.BuildEnvironment(config: Config)[source]#

Bases: LoggerMixin

A class implementing a simple build environment.

first_party_sources_headers() Iterator[Path][source]#

Get all first-party sources and headers. This could be useful for formatting or static analysis tooling where third-party sources should be excluded.

set_board_sources(board: Board, regular: Set[Path], apps: Set[Path]) SourceSets[source]#

Finalize source sets for a given board.

class yambs.environment.SourceSets(regular: Set[Path], apps: Set[Path])[source]#

Bases: NamedTuple

A structure for managing different kinds of source paths.

apps: Set[Path]#

Alias for field number 1

implicit_sources() Iterator[Tuple[Path, SourceTranslator]][source]#

Iterate over generated sources.

Get all sources that are directly provided to the linker.

regular: Set[Path]#

Alias for field number 0

sources() Iterator[Tuple[Path, SourceTranslator]][source]#

Iterate over sources and their source translator.