|
68 | 68 | //! number of different environment variables.
|
69 | 69 | //!
|
70 | 70 | //! * `CFLAGS` - a series of space separated flags passed to compilers. Note that
|
71 |
| -//! individual flags cannot currently contain spaces, so doing |
72 |
| -//! something like: `-L=foo\ bar` is not possible. |
| 71 | +//! individual flags cannot currently contain spaces, so doing |
| 72 | +//! something like: `-L=foo\ bar` is not possible. |
73 | 73 | //! * `CC` - the actual C compiler used. Note that this is used as an exact
|
74 |
| -//! executable name, so (for example) no extra flags can be passed inside |
75 |
| -//! this variable, and the builder must ensure that there aren't any |
76 |
| -//! trailing spaces. This compiler must understand the `-c` flag. For |
77 |
| -//! certain `TARGET`s, it also is assumed to know about other flags (most |
78 |
| -//! common is `-fPIC`). |
| 74 | +//! executable name, so (for example) no extra flags can be passed inside |
| 75 | +//! this variable, and the builder must ensure that there aren't any |
| 76 | +//! trailing spaces. This compiler must understand the `-c` flag. For |
| 77 | +//! certain `TARGET`s, it also is assumed to know about other flags (most |
| 78 | +//! common is `-fPIC`). |
79 | 79 | //! * `AR` - the `ar` (archiver) executable to use to build the static library.
|
80 | 80 | //! * `CRATE_CC_NO_DEFAULTS` - the default compiler flags may cause conflicts in
|
81 |
| -//! some cross compiling scenarios. Setting this variable |
82 |
| -//! will disable the generation of default compiler |
83 |
| -//! flags. |
| 81 | +//! some cross compiling scenarios. Setting this variable |
| 82 | +//! will disable the generation of default compiler |
| 83 | +//! flags. |
84 | 84 | //! * `CC_ENABLE_DEBUG_OUTPUT` - if set, compiler command invocations and exit codes will
|
85 |
| -//! be logged to stdout. This is useful for debugging build script issues, but can be |
86 |
| -//! overly verbose for normal use. |
| 85 | +//! be logged to stdout. This is useful for debugging build script issues, but can be |
| 86 | +//! overly verbose for normal use. |
87 | 87 | //! * `CXX...` - see [C++ Support](#c-support).
|
88 | 88 | //!
|
89 | 89 | //! Furthermore, projects using this crate may specify custom environment variables
|
|
133 | 133 | //! required varies per platform, but there are three broad categories:
|
134 | 134 | //!
|
135 | 135 | //! * Unix platforms require `cc` to be the C compiler. This can be found by
|
136 |
| -//! installing cc/clang on Linux distributions and Xcode on macOS, for example. |
| 136 | +//! installing cc/clang on Linux distributions and Xcode on macOS, for example. |
137 | 137 | //! * Windows platforms targeting MSVC (e.g. your target triple ends in `-msvc`)
|
138 |
| -//! require Visual Studio to be installed. `cc-rs` attempts to locate it, and |
139 |
| -//! if it fails, `cl.exe` is expected to be available in `PATH`. This can be |
140 |
| -//! set up by running the appropriate developer tools shell. |
| 138 | +//! require Visual Studio to be installed. `cc-rs` attempts to locate it, and |
| 139 | +//! if it fails, `cl.exe` is expected to be available in `PATH`. This can be |
| 140 | +//! set up by running the appropriate developer tools shell. |
141 | 141 | //! * Windows platforms targeting MinGW (e.g. your target triple ends in `-gnu`)
|
142 |
| -//! require `cc` to be available in `PATH`. We recommend the |
143 |
| -//! [MinGW-w64](https://www.mingw-w64.org/) distribution, which is using the |
144 |
| -//! [Win-builds](http://win-builds.org/) installation system. |
145 |
| -//! You may also acquire it via |
146 |
| -//! [MSYS2](https://www.msys2.org/), as explained [here][msys2-help]. Make sure |
147 |
| -//! to install the appropriate architecture corresponding to your installation of |
148 |
| -//! rustc. GCC from older [MinGW](http://www.mingw.org/) project is compatible |
149 |
| -//! only with 32-bit rust compiler. |
| 142 | +//! require `cc` to be available in `PATH`. We recommend the |
| 143 | +//! [MinGW-w64](https://www.mingw-w64.org/) distribution, which is using the |
| 144 | +//! [Win-builds](http://win-builds.org/) installation system. |
| 145 | +//! You may also acquire it via |
| 146 | +//! [MSYS2](https://www.msys2.org/), as explained [here][msys2-help]. Make sure |
| 147 | +//! to install the appropriate architecture corresponding to your installation of |
| 148 | +//! rustc. GCC from older [MinGW](http://www.mingw.org/) project is compatible |
| 149 | +//! only with 32-bit rust compiler. |
150 | 150 | //!
|
151 | 151 | //! [msys2-help]: https://github.com/rust-lang/rust#building-on-windows
|
152 | 152 | //!
|
@@ -820,7 +820,7 @@ impl Build {
|
820 | 820 | /// 1. If [`cpp_link_stdlib`](Build::cpp_link_stdlib) is set, use its value.
|
821 | 821 | /// 2. Else if the `CXXSTDLIB` environment variable is set, use its value.
|
822 | 822 | /// 3. Else the default is `libc++` for OS X and BSDs, `libc++_shared` for Android,
|
823 |
| - /// `None` for MSVC and `libstdc++` for anything else. |
| 823 | + /// `None` for MSVC and `libstdc++` for anything else. |
824 | 824 | pub fn cpp(&mut self, cpp: bool) -> &mut Build {
|
825 | 825 | self.cpp = cpp;
|
826 | 826 | self
|
@@ -3135,7 +3135,7 @@ impl Build {
|
3135 | 3135 | /// 1. If [`cpp_link_stdlib`](cc::Build::cpp_link_stdlib) is set, uses its value.
|
3136 | 3136 | /// 2. Else if the `CXXSTDLIB` environment variable is set, uses its value.
|
3137 | 3137 | /// 3. Else the default is `libc++` for OS X and BSDs, `libc++_shared` for Android,
|
3138 |
| - /// `None` for MSVC and `libstdc++` for anything else. |
| 3138 | + /// `None` for MSVC and `libstdc++` for anything else. |
3139 | 3139 | fn get_cpp_link_stdlib(&self) -> Result<Option<Cow<'_, Path>>, Error> {
|
3140 | 3140 | match &self.cpp_link_stdlib {
|
3141 | 3141 | Some(s) => Ok(s.as_deref().map(Path::new).map(Cow::Borrowed)),
|
|
0 commit comments