pub enum Dialect {
GnuLike,
Msvc,
}Expand description
A compiler command-line family. Selected from the detected C++ compiler and threaded through planning and Ninja generation so every artifact name and command line speaks one dialect.
Variants§
GnuLike
GCC / Clang. Object files end in .o, static libraries are
lib<name>.a, executables have no extension, and header
dependencies are tracked with GCC-style depfiles.
Msvc
Microsoft Visual C++ (cl.exe / lib.exe). Object files end
in .obj, static libraries are <name>.lib, executables end
in .exe, and header dependencies are tracked with
/showIncludes.
Implementations§
Source§impl Dialect
impl Dialect
Sourcepub fn from_compiler_kind(kind: CompilerKind) -> Dialect
pub fn from_compiler_kind(kind: CompilerKind) -> Dialect
Pick the dialect a compiler family speaks. MSVC-dialect
compilers (cl.exe and Clang’s clang-cl driver) drive the
MSVC dialect; every other recognized (or unrecognized)
compiler drives the GCC/Clang dialect, which is also the
safe default for hosts where detection has not run.
Sourcepub fn host_default() -> Dialect
pub fn host_default() -> Dialect
The dialect to assume for the host when no compiler detection
has run. Used by tooling paths (e.g. cabin tidy) that resolve
but do not probe the toolchain: Windows defaults to MSVC, every
other host to GCC/Clang, matching the default toolchain each
host resolves.
Sourcepub fn object_extension(self) -> &'static str
pub fn object_extension(self) -> &'static str
Extension (without the leading dot) for compiled object files.
Sourcepub fn static_library_name(self, stem: &str) -> String
pub fn static_library_name(self, stem: &str) -> String
File name of the static library built from target stem.
Sourcepub fn executable_name(self, stem: &str) -> String
pub fn executable_name(self, stem: &str) -> String
File name of the executable built from target stem.
Sourcepub fn ninja_deps(self) -> NinjaDeps
pub fn ninja_deps(self) -> NinjaDeps
How Ninja should discover header dependencies for compiles in this dialect.
Trait Implementations§
impl Copy for Dialect
impl Eq for Dialect
impl StructuralPartialEq for Dialect
Auto Trait Implementations§
impl Freeze for Dialect
impl RefUnwindSafe for Dialect
impl Send for Dialect
impl Sync for Dialect
impl Unpin for Dialect
impl UnsafeUnpin for Dialect
impl UnwindSafe for Dialect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.