Skip to main content

Crate cuno_toolchain

Crate cuno_toolchain 

Source
Expand description

Compiler abstraction, detection, per-compiler implementations, and flag translation.

See docs/en/specs/toolchain.md.

Modules§

compiler
The compilers cuno can build with, and every fact about one that the rest of the crate branches on. Each fact is answered here by a match that names every compiler, so a new one does not compile until each is answered for it (docs/en/specs/toolchain.md, “Compiler abstraction”). Elsewhere, code asks these questions rather than comparing kinds.
flags
Turning settings into compiler arguments. See docs/en/specs/build.md, “Settings and flags”.
gcc
MinGW GCC: finding gcc (and the g++ beside it). See docs/en/specs/toolchain.md, “MinGW (GCC)”.
llvm
LLVM: finding clang, clang-cl, clang-format and clang-tidy. See docs/en/specs/toolchain.md, “LLVM (clang / clang-cl / clang-format / clang-tidy)”.
msvc
MSVC: finding Visual Studio and its toolsets, and the environment a compile needs. See docs/en/specs/toolchain.md, “Visual Studio / Build Tools” and “Environment resolution on Windows”.
prepare
What every command that compiles does before it compiles: find the compilers and tools, then, for the selected compiler, resolve the environment it runs in. cuno doctor and the build commands both call these, so they diagnose and build with the same answers.
probe
The standard library probe: whether the MSVC standard library accepts the selected Clang, and clang-tidy, asked by compiling a file that includes <yvals_core.h> (docs/en/specs/toolchain.md, “Minimum compiler versions”). Selection decides which compiler; this asks whether it can build here.
select
Choosing the compiler: which one the user asked for, and which installed copy satisfies the version requirements. See docs/en/specs/toolchain.md, “Selection” and “Version pinning”. Whether the copy chosen can build here is crate::probe’s.
short_path
A path’s short (8.3) name, for tools that open paths in the ANSI code page and so cannot open one that is not ASCII (docs/en/specs/ toolchain.md, “MinGW (GCC)”). The one place cuno calls Windows itself.

Structs§

Output
What a finished program returned.
SystemRunner
The real Runner, which starts processes and stops any that runs longer than TOOL_TIMEOUT. The binary passes it in.
Version
A three-part version, compared part by part.

Enums§

HostOs
The host operating system, as far as finding tools cares.
ToolchainError
A toolchain problem.

Constants§

TOOL_TIMEOUT
How long a tool may run before it is stopped (docs/en/specs/toolchain.md, “Detection”).

Traits§

Runner
Runs a program and waits for it.