Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 'binary' feature to reduce lib dependencies #26

Merged
merged 1 commit into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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