File tree Expand file tree Collapse file tree 6 files changed +50
-24
lines changed Expand file tree Collapse file tree 6 files changed +50
-24
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ cc_library(
23
23
"src/**/*.h" ,
24
24
],
25
25
exclude = [
26
- "src/**/wavm*" ,
27
26
"src/**/v8*" ,
27
+ "src/**/wasmtime*" ,
28
+ "src/**/wavm*" ,
28
29
],
29
30
),
30
31
hdrs = glob (["src/**/*.h" ]),
@@ -34,7 +35,6 @@ cc_library(
34
35
"@boringssl//:crypto" ,
35
36
"@com_google_protobuf//:protobuf_lite" ,
36
37
"@proxy_wasm_cpp_sdk//:api_lib" ,
37
- "@wamr//:wamr_lib" ,
38
- "@wasm_c_api//:wasmtime_lib" ,
38
+ "@wamr//:libiwasm" ,
39
39
],
40
40
)
Original file line number Diff line number Diff line change @@ -7,3 +7,7 @@ proxy_wasm_cpp_host_repositories()
7
7
load ("@proxy_wasm_cpp_host//bazel:dependencies.bzl" , "proxy_wasm_cpp_host_dependencies" )
8
8
9
9
proxy_wasm_cpp_host_dependencies ()
10
+
11
+ load ("@rules_foreign_cc//foreign_cc:repositories.bzl" , "rules_foreign_cc_dependencies" )
12
+
13
+ rules_foreign_cc_dependencies ()
Original file line number Diff line number Diff line change 1
1
licenses(["notice"]) # Apache 2
2
2
3
- package(default_visibility = ["//visibility:public"] )
3
+ load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake" )
4
4
5
- cc_import(
6
- name = "linklib",
7
- shared_library = "library/linux-classic_interp-multi_module-dbg/libiwasm.so",
8
- )
5
+ package(default_visibility = ["//visibility:public"])
9
6
10
- cc_library(
11
- name = "headlib",
12
- hdrs = glob(["include/*.h"]),
13
- srcs = glob(["include/*.c"]),
14
- include_prefix = "wamr",
7
+ filegroup(
8
+ name = "srcs",
9
+ srcs = glob(["**"]),
10
+ visibility = ["//visibility:public"],
15
11
)
16
12
17
- cc_library(
18
- name = "wamr_lib",
19
- defines = ["WASM_WAMR"],
20
- deps = [
21
- "linklib",
22
- "headlib",
23
- ],
13
+ cmake(
14
+ name = "libiwasm",
15
+ cache_entries = {
16
+ "CMAKE_BUILD_TYPE": "Debug",
17
+ "CMAKE_EXPORT_COMPILE_COMMANDS": "On",
18
+ "WAMR_BUILD_AOT": "0",
19
+ "WAMR_BUILD_SIMD": "0",
20
+ },
21
+ lib_source = ":srcs",
22
+ out_shared_libs = ["libiwasm.so"],
23
+ working_directory = "product-mini/platforms/linux"
24
24
)
Original file line number Diff line number Diff line change @@ -52,6 +52,19 @@ def proxy_wasm_cpp_host_repositories():
52
52
url = "https://github.com/lum1n0us/wasm-micro-runtime/releases/download/WAMR-01-29-2021/wamr_pre_release.zip" ,
53
53
)
54
54
55
+ http_archive (
56
+ name = "wamr" ,
57
+ build_file = "@proxy_wasm_cpp_host//bazel/external:wamr.BUILD" ,
58
+ sha256 = "88cd7145d7098daacfb0da51548327f4e5303d17ea27611cde6f47c6f7b68059" ,
59
+ url = "https://github.com/lum1n0us/wasm-micro-runtime/releases/download/WAMR-01-29-2021/source.zip" ,
60
+ )
61
+
62
+ # native.new_local_repository(
63
+ # name = "wamr",
64
+ # build_file = "@proxy_wasm_cpp_host//bazel/external:wamr.BUILD",
65
+ # path = "/source/wamr",
66
+ # )
67
+
55
68
http_archive (
56
69
name = "wasm_c_api" ,
57
70
build_file = "@proxy_wasm_cpp_host//bazel/external:wasm-c-api.BUILD" ,
@@ -73,3 +86,10 @@ def proxy_wasm_cpp_host_repositories():
73
86
strip_prefix = "protobuf-655310ca192a6e3a050e0ca0b7084a2968072260" ,
74
87
url = "https://github.com/protocolbuffers/protobuf/archive/655310ca192a6e3a050e0ca0b7084a2968072260.tar.gz" ,
75
88
)
89
+
90
+ http_archive (
91
+ name = "rules_foreign_cc" ,
92
+ sha256 = "d54742ffbdc6924f222d2179f0e10e911c5c659c4ae74158e9fe827aad862ac6" ,
93
+ strip_prefix = "rules_foreign_cc-0.2.0" ,
94
+ url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.2.0.tar.gz" ,
95
+ )
Original file line number Diff line number Diff line change 13
13
// limitations under the License.
14
14
15
15
#include " src/common/types.h"
16
- #include " wamr/include/ wasm_c_api.h"
16
+ #include " wasm_c_api.h"
17
17
18
18
namespace proxy_wasm {
19
19
namespace wamr {
Original file line number Diff line number Diff line change 30
30
#include < vector>
31
31
32
32
#include " src/wamr/types.h"
33
- #include " wamr/include/ wasm_c_api.h"
33
+ #include " wasm_c_api.h"
34
34
35
35
namespace proxy_wasm {
36
36
namespace wamr {
@@ -60,7 +60,6 @@ class Wamr : public WasmVm {
60
60
61
61
Cloneable cloneable () override {
62
62
return Cloneable::CompiledBytecode;
63
- ;
64
63
}
65
64
std::unique_ptr<WasmVm> clone () override ;
66
65
@@ -167,7 +166,8 @@ std::unique_ptr<WasmVm> Wamr::clone() {
167
166
168
167
WasmByteVec stripped;
169
168
clone->module_ =
170
- wasm_module_new (store_.get (), getStrippedSource (&stripped) ? stripped.get () : source_.get ());
169
+ wasm_module_new (clone->store_ .get (), getStrippedSource (&stripped) ? stripped.get () : source_.get ());
170
+
171
171
return clone;
172
172
}
173
173
@@ -765,3 +765,5 @@ AbiVersion Wamr::getAbiVersion() {
765
765
std::unique_ptr<WasmVm> createWamrVm () { return std::make_unique<wamr::Wamr>(); }
766
766
767
767
} // namespace proxy_wasm
768
+
769
+
You can’t perform that action at this time.
0 commit comments