Skip to main content

CompilerKind

Enum CompilerKind 

Source
pub enum CompilerKind {
    Msvc,
    Clang,
    ClangCl,
    Gcc,
}
Expand description

A compiler cuno can build with.

Variants§

§

Msvc

cl.exe.

§

Clang

clang with GCC-style flags.

§

ClangCl

clang-cl, Clang with MSVC-style flags.

§

Gcc

MinGW-w64’s GCC (docs/en/specs/toolchain.md, “MinGW (GCC)”).

Implementations§

Source§

impl CompilerKind

Source

pub const ALL: [CompilerKind; 4]

Every compiler, in the order cuno lists them. A new variant is added here as well as to the matches below.

Source

pub const fn name(self) -> &'static str

The name used in settings (msvc, clang, clang-cl).

Source

pub fn syntax(self) -> Syntax

How its command line is written.

Source

pub fn family(self) -> Family

Whose compiler it is.

Source

pub fn found_by_running(self) -> bool

Whether finding it means running it, so that it is looked for only when it is wanted (docs/en/specs/toolchain.md, “MinGW (GCC)”): each GCC copy on PATH is run to learn what it is. The others are found by their files. A new compiler must answer here before detection can be asked for it.

Source

pub fn uses_msvc_toolset(self, host: HostOs) -> bool

Whether it builds with an MSVC toolset (its standard library, the Windows SDK and its environment) on host, so selecting it needs Visual Studio (docs/en/specs/toolchain.md, “Environment resolution on Windows”). On Windows cl does, and Clang and clang-cl target the MSVC ABI and borrow its toolset; elsewhere none does (cl does not run there, and is refused as not found). MinGW’s GCC brings its own headers, libraries and runtime. A new compiler must answer here before it can be selected.

Source

pub fn borrows_msvc_toolset(self) -> bool

Whether it borrows an MSVC toolset it is not part of: the Clangs do, so cuno doctor names the toolset they use; cl’s own is its Selected line, and GCC uses none (docs/en/specs/commands.md, “What cuno doctor prints”).

Source

pub fn uses_msvc_stl(self) -> bool

Whether it builds against the MSVC standard library, whose switches (_HAS_EXCEPTIONS) cuno sets: cl and the Clangs do, MinGW’s GCC uses libstdc++ (docs/en/specs/build.md, “Settings and flags”).

Source

pub fn needs_ascii_paths(self) -> bool

Whether the tools it runs open paths in the ANSI code page, so that what they create or read must be named in ASCII: MinGW’s assembler and linker do (docs/en/specs/toolchain.md, “MinGW (GCC)”); cl, the Clangs and lld open them as Unicode.

The driver that links objects compiled by program, when any is C++ (cxx): GCC’s gcc adds no C++ standard library, so C++ links with the g++ beside it (docs/en/specs/build.md, “Linking”); every other driver links both languages.

Source

pub fn echoes_source_name(self) -> bool

Whether it prints the source’s name on stdout for each compile, which the build leaves out of what it shows: cl does, the LLVM drivers and GCC do not.

Source

pub fn checks_by_compiling(self) -> bool

Whether cuno check compiles as the build does, without linking, rather than checking syntax alone: cl’s /Zs misses diagnostics raised during code generation (C4716, and C4700, C4701 and C4715 under warnings-as-errors), which clang and clang-cl report when checking; GCC’s -fsyntax-only misses those its optimiser raises (-Warray-bounds, -Wstringop-overflow) (docs/en/specs/build.md, “Always-on flags”).

Source

pub fn dependencies(self) -> Dependencies

How it says which headers a compile read.

Source

pub fn llvm_tool(self) -> Option<Tool>

The LLVM tool it is found as, for the LLVM family.

Trait Implementations§

Source§

impl Clone for CompilerKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CompilerKind

Source§

impl Debug for CompilerKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CompilerKind

Source§

impl PartialEq for CompilerKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CompilerKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.