Skip to main content

Module cc

Module cc 

Source
Expand description

Compiler wrappers for C dependencies (libc-cc, and libc-cxx to refuse C++).

cargo libc points the cc crate (and CMake through it) at these wrappers. Cargo builds host and target units for the same triple, so the triple cannot tell them apart; the wrapper uses the build script’s CARGO_CFG_CARGO_LIBC_PROFILE, which only target units have (it comes from the target rustflags). Target compiles get the selected sysroot or provider; host compiles run the host compiler unchanged.

Enums§

Language
The language a wrapper compiles: which executable is running.

Functions§

run
The libc-cc and libc-cxx entry point. Compiles with the arguments the process was started with: target units with Clang and the selected sysroot or provider, host units with the host compiler unchanged. Returns the compiler’s exit code, or 1 after printing why the compile could not run (for example C++ for the target).