Add cmake compatibility to c-api (#4369)
* Add cmake compatibility to c-api * Add CMake documentation to wasmtime.h * Add CMake instructions in examples * Modify CI for CMake support * Use correct rust in CI * Trigger build * Refactor run-examples * Reintroduce example_to_run in run-examples * Replace run-examples crate with cmake * Fix markdown formatting in examples readme * Fix cmake test quotes * Build rust wasm before cmake tests * Pass CTEST_OUTPUT_ON_FAILURE * Another cmake test * Handle os differences in cmake test * Fix bugs in memory and multimemory examples
This commit is contained in:
@@ -28,6 +28,22 @@
|
||||
* as a `lib` directory with both a static archive and a dynamic library of
|
||||
* Wasmtime. You can link to either of them as you see fit.
|
||||
*
|
||||
* ## Installing the C API through CMake
|
||||
*
|
||||
* CMake can be used to make the process of linking and compiling easier. An
|
||||
* example of this if you have wasmtime as a git submodule at
|
||||
* `third_party/wasmtime`:
|
||||
* ```
|
||||
* add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/wasmtime/crates/c-api
|
||||
* ${CMAKE_CURRENT_BINARY_DIR}/wasmtime)
|
||||
* ...
|
||||
* target_include_directories(YourProject PUBLIC wasmtime)
|
||||
* target_link_libraries(YourProject PUBLIC wasmtime)
|
||||
* ```
|
||||
* `BUILD_SHARED_LIBS` is provided as a define if you would like to build a
|
||||
* shared library instead. You must distribute the appropriate shared library
|
||||
* for your platform if you do this.
|
||||
*
|
||||
* ## Linking against the C API
|
||||
*
|
||||
* You'll want to arrange the `include` directory of the C API to be in your
|
||||
@@ -166,8 +182,8 @@
|
||||
|
||||
#include <wasi.h>
|
||||
#include <wasmtime/config.h>
|
||||
#include <wasmtime/error.h>
|
||||
#include <wasmtime/engine.h>
|
||||
#include <wasmtime/error.h>
|
||||
#include <wasmtime/extern.h>
|
||||
#include <wasmtime/func.h>
|
||||
#include <wasmtime/global.h>
|
||||
|
||||
Reference in New Issue
Block a user