|
95 | 95 | //! dependencies. Note that operations that return [`Tool`]s such as
|
96 | 96 | //! [`Build::get_compiler`] may produce less accurate results as in some cases `cc` runs
|
97 | 97 | //! commands in order to locate compilers. Additionally, this does nothing to prevent
|
98 |
| -//! users from running [`Tool::to_command`] and executing the [`Command`] themselves.//! |
| 98 | +//! users from running [`Tool::to_command`] and executing the [`Command`] themselves. |
| 99 | +//! * `RUSTC_WRAPPER` - If set, the specified command will be prefixed to the compiler |
| 100 | +//! command. This is useful for projects that want to use |
| 101 | +//! [sccache](https://github.com/mozilla/sccache), |
| 102 | +//! [buildcache](https://gitlab.com/bits-n-bites/buildcache), or |
| 103 | +//! [cachepot](https://github.com/paritytech/cachepot). |
99 | 104 | //!
|
100 | 105 | //! Furthermore, projects using this crate may specify custom environment variables
|
101 | 106 | //! to be inspected, for example via the `Build::try_flags_from_environment`
|
|
215 | 220 | //! .file("bar.cu")
|
216 | 221 | //! .compile("bar");
|
217 | 222 | //! ```
|
| 223 | +//! |
| 224 | +//! # Speed up compilation with sccache |
| 225 | +//! |
| 226 | +//! `cc-rs` does not handle incremental compilation like `make` or `ninja`. It |
| 227 | +//! always compiles the all sources, no matter if they have changed or not. |
| 228 | +//! This would be time-consuming in large projects. To save compilation time, |
| 229 | +//! you can use [sccache](https://github.com/mozilla/sccache) by setting |
| 230 | +//! environment variable `RUSTC_WRAPPER=sccache`, which will use cached `.o` |
| 231 | +//! files if the sources are unchanged. |
218 | 232 |
|
219 | 233 | #![doc(html_root_url = "https://docs.rs/cc/1.0")]
|
220 | 234 | #![deny(warnings)]
|
|
0 commit comments