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
impl CompilerKind
Sourcepub const ALL: [CompilerKind; 4]
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.
Sourcepub fn found_by_running(self) -> bool
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.
Sourcepub fn uses_msvc_toolset(self, host: HostOs) -> bool
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.
Sourcepub fn borrows_msvc_toolset(self) -> bool
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”).
Sourcepub fn uses_msvc_stl(self) -> bool
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”).
Sourcepub fn needs_ascii_paths(self) -> bool
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.
Sourcepub fn link_driver(self, program: &Path, cxx: bool) -> PathBuf
pub fn link_driver(self, program: &Path, cxx: bool) -> PathBuf
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.
Sourcepub fn echoes_source_name(self) -> bool
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.
Sourcepub fn checks_by_compiling(self) -> bool
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”).
Sourcepub fn dependencies(self) -> Dependencies
pub fn dependencies(self) -> Dependencies
How it says which headers a compile read.