https://github.com/fathyb/po6
A C POSIX library in Rust
https://github.com/fathyb/po6
Last synced: over 1 year ago
JSON representation
A C POSIX library in Rust
- Host: GitHub
- URL: https://github.com/fathyb/po6
- Owner: fathyb
- License: mit
- Created: 2023-09-04T05:06:11.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-06T10:30:58.000Z (almost 3 years ago)
- Last Synced: 2025-03-14T15:51:49.566Z (over 1 year ago)
- Language: C
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# `po6`
A C POSIX library in Rust meant for building C libraries in environments
without one (eg. `wasm32-unknown-unknown` or Windows).
Makes it possibles to build C libraries with `wasm-bindgen`, which is not
compatible with `emscripten`.
## Usage
1. Install it to your `build-dependencies`:
```console
$ cargo add po6 --build
```
2. Use it in your `build.rs` by adding the output of `po6::build` to your include paths:
```rust
cc::Build::new()
.includes(po6::build()?)
```
3. Use it in your `lib.rs` by including the generated runtime file:
```rust
mod po6 {
include!(concat!(env!("OUT_DIR"), "/po6.rs"));
}
```