I would like to make a project that contains:
- a library
- bindings for C
- an executable that uses the library
The directory structure, excluding temporary files and other trash:
.
├── Cargo.toml
├── src
│ ├── c_bindings.rs // contains C bindings for library
│ ├── compression.rs
│ ├── const_data.rs
│ ├── hash.rs
│ ├── lib.rs // library
│ └── main.rs // simple executable that uses library
└── target
└── debug
├── gost_stribog
├── libgost_stribog.rlib
I want cargo build
do this:
- build Rust library (rlib) that will ignore
c_bindings.rs
- C library (dylib) that will use
c_bindings.rs
- executable
The debug directory should be:
└── target
└── debug
├── gost_stribog
├── libgost_stribog.rlib
├── libgost_stribog.so
What should my Cargo.toml
look like?