Skip to content

Commit

Permalink
Merge pull request #32 from zec/using-libclang
Browse files Browse the repository at this point in the history
Update to USING doc about `libclang` dep
  • Loading branch information
zec authored Nov 14, 2023
2 parents 7a63a54 + 839a6fc commit e30a4d5
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions USING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ This is what you need to do:

## Prerequisites

First off, you need to [install Rust], if you haven't done so already.
First off, you will need the C toolchain and other build tools (_e.g._, CMake)
you are using to build the rest of your cFS system.

Next, you need to [install Rust], if you haven't done so already.
Make sure the `cargo` tool is in your `$PATH`.

For the time being, we need the `nightly` release channel
Expand All @@ -17,16 +20,27 @@ If you're using `rustup` to manage your Rust installation, this will add
that channel:

```sh
$ rustup toolchain install nightly
rustup toolchain install nightly
```

We also need the Rust standard library's source code
(for reasons relating to how we handle panics):

```sh
$ rustup +nightly component add rust-src
rustup +nightly component add rust-src
```

Finally, you will need to install `libclang` and the associated development files,
as they are required for automated generation of low-level bindings to cFS C APIs.
For example, on most Debian-like systems, you can run the following (as `root`):

```sh
apt install libclang-[n]-dev libclang1-[n]
```

where `[n]` is some version of `clang` (generally, the newer the better,
but [version 5 at minimum]).

## Build system additions

The `cfs-sys` crate,
Expand Down Expand Up @@ -185,6 +199,7 @@ You can find a fully worked-out example of a Rust-using cFS application at
[install rust]: https://www.rust-lang.org/tools/install
[1]: https://rust-lang.github.io/rustup/concepts/channels.html
[2]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
[version 5 at minimum]: https://rust-lang.github.io/rust-bindgen/requirements.html
[a little configuration]: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-reads
[shared compile caches]: https://doc.rust-lang.org/cargo/guide/build-cache.html#shared-cache
[sccache]: https://github.com/mozilla/sccache
Expand Down

0 comments on commit e30a4d5

Please sign in to comment.