Python WAMR API binding: Add malloc/free and register_native (#1989)
This commit is contained in:
@ -1,16 +1,8 @@
|
||||
# WARM API
|
||||
|
||||
## Examples
|
||||
## Setup
|
||||
|
||||
Copy in `language-bindings/python/wamr/libs` the library `libiwasm` generated from `product-mini/platforms`.
|
||||
|
||||
There is a [simple example](./samples/main.py) to show how to use bindings.
|
||||
|
||||
```
|
||||
python samples/main.py
|
||||
```
|
||||
|
||||
## Update WAMR API bindings
|
||||
### Pre-requisites
|
||||
|
||||
Install requirements,
|
||||
|
||||
@ -18,8 +10,20 @@ Install requirements,
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Run the following command,
|
||||
### Build native lib and update bindings
|
||||
|
||||
The following command builds the iwasm library and generates the Python bindings,
|
||||
|
||||
```sh
|
||||
ctypesgen ../../../../core/iwasm/include/wasm_export.h -l ../libs/libiwasm.so -o iwasm.py
|
||||
bash language-bindings/python/utils/create_lib.sh
|
||||
```
|
||||
|
||||
This will build and copy libiwasm into the package.
|
||||
|
||||
## Examples
|
||||
|
||||
There is a [simple example](./samples/main.py) to show how to use bindings.
|
||||
|
||||
```
|
||||
python samples/main.py
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user