-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for WebAssembly Micro Runtime (WAMR). (#142)
Fixes #134. Signed-off-by: Le Yao <le.yao@intel.com> Co-authored-by: Liang He <liang.he@intel.com>
- Loading branch information
Showing
9 changed files
with
758 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = glob(["**"]), | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cmake( | ||
name = "libiwasm", | ||
cache_entries = { | ||
"WAMR_BUILD_INTERP": "1", | ||
"WAMR_BUILD_JIT": "0", | ||
"WAMR_BUILD_AOT": "0", | ||
"WAMR_BUILD_SIMD": "0", | ||
"WAMR_BUILD_MULTI_MODULE": "1", | ||
"WAMR_BUILD_LIBC_WASI": "0", | ||
}, | ||
lib_source = ":srcs", | ||
out_shared_libs = ["libiwasm.so"], | ||
) |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2016-2019 Envoy Project Authors | ||
// Copyright 2020 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
|
||
#include "include/proxy-wasm/wasm_vm.h" | ||
|
||
namespace proxy_wasm { | ||
|
||
std::unique_ptr<WasmVm> createWamrVm(); | ||
|
||
} // namespace proxy_wasm |
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,45 @@ | ||
// Copyright 2020 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "src/common/types.h" | ||
#include "wasm_c_api.h" | ||
|
||
namespace proxy_wasm { | ||
namespace wamr { | ||
|
||
using WasmEnginePtr = common::CSmartPtr<wasm_engine_t, wasm_engine_delete>; | ||
using WasmFuncPtr = common::CSmartPtr<wasm_func_t, wasm_func_delete>; | ||
using WasmStorePtr = common::CSmartPtr<wasm_store_t, wasm_store_delete>; | ||
using WasmModulePtr = common::CSmartPtr<wasm_module_t, wasm_module_delete>; | ||
using WasmMemoryPtr = common::CSmartPtr<wasm_memory_t, wasm_memory_delete>; | ||
using WasmTablePtr = common::CSmartPtr<wasm_table_t, wasm_table_delete>; | ||
using WasmInstancePtr = common::CSmartPtr<wasm_instance_t, wasm_instance_delete>; | ||
using WasmFunctypePtr = common::CSmartPtr<wasm_functype_t, wasm_functype_delete>; | ||
using WasmTrapPtr = common::CSmartPtr<wasm_trap_t, wasm_trap_delete>; | ||
using WasmExternPtr = common::CSmartPtr<wasm_extern_t, wasm_extern_delete>; | ||
|
||
using WasmByteVec = | ||
common::CSmartType<wasm_byte_vec_t, wasm_byte_vec_new_empty, wasm_byte_vec_delete>; | ||
using WasmImporttypeVec = common::CSmartType<wasm_importtype_vec_t, wasm_importtype_vec_new_empty, | ||
wasm_importtype_vec_delete>; | ||
using WasmExportTypeVec = common::CSmartType<wasm_exporttype_vec_t, wasm_exporttype_vec_new_empty, | ||
wasm_exporttype_vec_delete>; | ||
using WasmExternVec = | ||
common::CSmartType<wasm_extern_vec_t, wasm_extern_vec_new_empty, wasm_extern_vec_delete>; | ||
using WasmValtypeVec = | ||
common::CSmartType<wasm_valtype_vec_t, wasm_valtype_vec_new_empty, wasm_valtype_vec_delete>; | ||
|
||
} // namespace wamr | ||
|
||
} // namespace proxy_wasm |
Oops, something went wrong.