-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
112 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
.idea | ||
**/.vscode | ||
install/ | ||
capi/ | ||
api-docs/ | ||
api-docs-repo/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
name = "wasmer-runtime-c-api" | ||
version = "0.13.1" | ||
description = "Wasmer C API library" | ||
documentation = "https://wasmerio.github.io/wasmer/c/runtime-c-api/" | ||
license = "MIT" | ||
authors = ["The Wasmer Engineering Team <[email protected]>"] | ||
repository = "https://github.com/wasmerio/wasmer" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Wasmer C API | ||
|
||
This is the [Wasmer WebAssembly Runtime](https://wasmer.io) shared library. | ||
You can use it in any C/C++ projects. | ||
|
||
This directory is structured like the following: | ||
* `lib` is where the Wasmer shared library lives. | ||
* `include` is where the Wasmer headers live | ||
|
||
## Documentation | ||
|
||
The API documentation for the Wasmer Runtime C API can be found here: | ||
|
||
https://wasmerio.github.io/wasmer/c/runtime-c-api/ | ||
|
||
|
||
## Usage | ||
|
||
If you want to compile a `c` file using Wasmer, you can do: | ||
|
||
```bash | ||
clang YOUR_FILE -Iinclude -lwasmer -Llib | ||
``` | ||
|
||
> Note: append ` -rpath lib` if you are in macOS. | ||
## Examples | ||
|
||
You can check examples of how to use the Wasmer C API here: | ||
|
||
https://docs.wasmer.io/integrations/c/examples | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
name = "wasmer-runtime" | ||
version = "0.13.1" | ||
description = "Wasmer runtime library" | ||
documentation = "https://wasmerio.github.io/wasmer/c/runtime-c-api/" | ||
license = "MIT" | ||
authors = ["The Wasmer Engineering Team <[email protected]>"] | ||
repository = "https://github.com/wasmerio/wasmer" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
initArch() { | ||
ARCH=$(uname -m) | ||
if [ -n "$WASMER_ARCH" ]; then | ||
ARCH="$WASMER_ARCH" | ||
fi | ||
# If you modify this list, please also modify install.sh | ||
case $ARCH in | ||
amd64) ARCH="amd64";; | ||
x86_64) ARCH="amd64";; | ||
aarch64) ARCH="arm64";; | ||
i386) ARCH="386";; | ||
*) echo "Architecture ${ARCH} is not supported by this installation script"; exit 1;; | ||
esac | ||
} | ||
|
||
initOS() { | ||
OS=$(uname | tr '[:upper:]' '[:lower:]') | ||
if [ -n "$WASMER_OS" ]; then | ||
echo "Using WASMER_OS" | ||
OS="$WASMER_OS" | ||
fi | ||
case "$OS" in | ||
darwin) OS='darwin';; | ||
linux) OS='linux';; | ||
freebsd) OS='freebsd';; | ||
# mingw*) OS='windows';; | ||
# msys*) OS='windows';; | ||
*) echo "OS ${OS} is not supported by this installation script"; exit 1;; | ||
esac | ||
} | ||
|
||
# identify platform based on uname output | ||
initArch | ||
initOS | ||
|
||
# determine install directory if required | ||
BINARY="wasmer-c-api-${OS}-${ARCH}.tar.gz" | ||
|
||
# add .exe if on windows | ||
# if [ "$OS" = "windows" ]; then | ||
# BINARY="$BINARY.exe" | ||
# fi | ||
|
||
echo "${BINARY}" |