Skip to content

Commit df2f86c

Browse files
authored
Harmonize README.md with reality. (#835)
1 parent e84367b commit df2f86c

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ you can call them from Rust by declaring them in
4949
your Rust code like so:
5050

5151
```rust,no_run
52-
extern {
52+
extern "C" {
5353
fn foo_function();
5454
fn bar_function(x: i32) -> i32;
5555
}
@@ -138,9 +138,9 @@ required varies per platform, but there are three broad categories:
138138
* Unix platforms require `cc` to be the C compiler. This can be found by
139139
installing cc/clang on Linux distributions and Xcode on macOS, for example.
140140
* Windows platforms targeting MSVC (e.g. your target triple ends in `-msvc`)
141-
require `cl.exe` to be available and in `PATH`. This is typically found in
142-
standard Visual Studio installations and the `PATH` can be set up by running
143-
the appropriate developer tools shell.
141+
require Visual Studio to be installed. `cc-rs` attempts to locate it, and
142+
if it fails, `cl.exe` is expected to be available in `PATH`. This can be
143+
set up by running the appropriate developer tools shell.
144144
* Windows platforms targeting MinGW (e.g. your target triple ends in `-gnu`)
145145
require `cc` to be available in `PATH`. We recommend the
146146
[MinGW-w64](https://www.mingw-w64.org/) distribution, which is using the
@@ -163,7 +163,7 @@ fn main() {
163163
cc::Build::new()
164164
.cpp(true) // Switch to C++ library compilation.
165165
.file("foo.cpp")
166-
.compile("libfoo.a");
166+
.compile("foo");
167167
}
168168
```
169169

@@ -178,7 +178,7 @@ The C++ standard library may be linked to the crate target. By default it's `lib
178178
.cpp(true)
179179
.file("foo.cpp")
180180
.cpp_link_stdlib("stdc++") // use libstdc++
181-
.compile("libfoo.a");
181+
.compile("foo");
182182
}
183183
```
184184
2. by setting the `CXXSTDLIB` environment variable.
@@ -190,7 +190,7 @@ Remember that C++ does name mangling so `extern "C"` might be required to enable
190190
## CUDA C++ support
191191
192192
`cc-rs` also supports compiling CUDA C++ libraries by using the `cuda` method
193-
on `Build` (currently for GNU/Clang toolchains only):
193+
on `Build`:
194194
195195
```rust,no_run
196196
fn main() {
@@ -208,8 +208,10 @@ fn main() {
208208
.flag("-gencode").flag("arch=compute_60,code=sm_60")
209209
// Generate code for Pascal (Jetson TX2).
210210
.flag("-gencode").flag("arch=compute_62,code=sm_62")
211+
// Generate code in parallel
212+
.flag("-t0")
211213
.file("bar.cu")
212-
.compile("libbar.a");
214+
.compile("bar");
213215
}
214216
```
215217

0 commit comments

Comments
 (0)