https://github.com/kkew3/expose-shared-library
This crate expose rust shared library to python/lua.
https://github.com/kkew3/expose-shared-library
lua python
Last synced: 2 months ago
JSON representation
This crate expose rust shared library to python/lua.
- Host: GitHub
- URL: https://github.com/kkew3/expose-shared-library
- Owner: kkew3
- License: mit
- Created: 2024-10-14T01:31:48.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-17T00:39:13.000Z (about 1 year ago)
- Last Synced: 2025-02-17T01:19:47.047Z (about 1 year ago)
- Topics: lua, python
- Language: Rust
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# expose-shared-library
[](https://github.com/kkew3/expose-shared-library/actions/workflows/ci.yml)
The crate originally intended to simplify manual build of pyo3 without [`maturin`][maturin], which can be useful in various circumstances.
Now it serves to expose the shared library to both python and lua.
## Functions
Only one function is provided: `expose_shared_library`.
This function exposes the rust shared library to python/lua side according to [pyo3 doc][pyo3-doc].
For usage, please refer to [`examples/mixed-rust-python-project/build.rs`](./examples/mixed-rust-python-project/build.rs) and [`examples/mixed-rust-lua-project/build.rs`](./examples/mixed-rust-lua-project/build.rs).
## Installation
```bash
cargo add \
--git https://github.com/kkew3/expose-shared-library.git \
expose-shared-library \
--tag 0.1.4 --build --features py
```
or
```bash
cargo add \
--git https://github.com/kkew3/expose-shared-library.git \
expose-shared-library \
--tag 0.1.4 --build --features lua
```
depending on the desired feature.
One of the features "py" or "lua" must be enabled, but not both.
[maturin]: https://www.maturin.rs
[pyo3-doc]: https://pyo3.rs/v0.22.2/building-and-distribution#manual-builds