Skip to content

Commit

Permalink
Added 'utilities' feature to reduce lib dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Lumbra committed Feb 3, 2023
1 parent e30f05b commit 194dab4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
17 changes: 16 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,25 @@ Linux Industrial I/O (IIO) Support
libiio-sys = { version = "0.3", path = "libiio-sys" }
thiserror = "1.0"
nix = "0.23"
clap = "2.34"
clap = { version = "2.34", optional = true }

[dev-dependencies]
schedule_recv = "0.1"
chrono = "0.4"
ctrlc = "3.2"
anyhow = "1.0"
clap = "2.34"

[features]
default = ["utilities"]
utilities = ["clap"]

# ----- Utilities -----

[[bin]]
name = "iio_info_rs"
required-features = ["utilities"]

[[bin]]
name = "riio_stop_all"
required-features = ["utilities"]
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ To keep up with the latest announcements for this project, follow:
### Unreleased Features in This Branch

- [#21](https://github.com/fpagliughi/rust-industrial-io/issues/21) Updated the nix dependency to the latest verison (v0.23)
- Create separate on-by-default 'utilities' feature to reduce dependencies for lib-only builds

### New in Version 0.5.1

Expand Down Expand Up @@ -241,12 +242,18 @@ $ iiod --version

## Build the Rust Crate

This is a fairly standard Rust wrapper project around a C library. It contains an unsafe _"-sys"_ sub-crate to wrap the C library API, and a higher-level, safe, Rust library in the main crate. To build them:
This is a fairly standard Rust wrapper project around a C library. It contains an unsafe _"-sys"_ sub-crate to wrap the C library API, and a higher-level, safe, Rust library in the main crate. The crate also contains utilities that interface with IIO devices via the library. To build the library and utilities:

```
$ cargo build
```

The library can be built with fewer dependencies. To build just the library:

```
$ cargo build --lib --no-default-features
```

There are also a number of example applications. They can all be built with:

```
Expand Down

0 comments on commit 194dab4

Please sign in to comment.