Skip to content

Commit

Permalink
Modularize the WASM VM code in preparation for upstreaming. (#117)
Browse files Browse the repository at this point in the history
* Modularize the WASM VM code in preparation for upstreaming.

Signed-off-by: John Plevyak <[email protected]>
  • Loading branch information
jplevyak authored Aug 12, 2019
1 parent b8f2703 commit 62fe0e6
Show file tree
Hide file tree
Showing 23 changed files with 1,152 additions and 993 deletions.
9 changes: 9 additions & 0 deletions source/extensions/common/wasm/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,19 @@ envoy_cc_library(
],
)

envoy_cc_library(
name = "wasm_vm_interface",
hdrs = ["wasm_vm.h"],
deps = [
":well_known_names",
],
)

envoy_cc_library(
name = "wasm_hdr",
hdrs = ["wasm.h"],
deps = [
":wasm_vm_interface",
":well_known_names",
"//include/envoy/http:codes_interface",
"//include/envoy/http:filter_interface",
Expand Down
39 changes: 20 additions & 19 deletions source/extensions/common/wasm/null/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,45 @@ load(
envoy_package()

envoy_cc_library(
name = "null_plugin_hdr",
name = "null_vm_plugin_interface",
hdrs = [
"wasm_api_impl.h",
],
deps = [
"//api/wasm/cpp:intrinsics_hdr",
"null_vm_plugin.h",
],
)

envoy_cc_library(
name = "null_lib",
srcs = ["null.cc"],
hdrs = ["null.h"],
srcs = [
"null.cc",
"null_vm.cc",
],
hdrs = [
"null.h",
"null_vm.h",
],
deps = [
":null_plugin_hdr",
":null_vm_plugin_interface",
"//external:abseil_node_hash_map",
"//include/envoy/registry",
"//source/common/common:assert_lib",
"//source/common/common:c_smart_ptr_lib",
"//source/common/protobuf",
"//source/extensions/common/wasm:wasm_hdr",
"//source/extensions/common/wasm:wasm_vm_interface",
"//source/extensions/common/wasm:well_known_names",
"@envoy_api//envoy/config/wasm/v2:wasm_cc",
],
)

# Sample builtin Null VM/Sandbox plugin, also used in tests.
envoy_cc_library(
name = "plugin",
srcs = [
"null_plugin_wrapper.cc", # The wrapper, copy and update the name.
"plugin.cc", # The plugin code.
name = "null_plugin_lib",
srcs = ["null_plugin.cc"],
hdrs = [
"null_plugin.h",
"wasm_api_impl.h",
],
copts = ["-DNULL_PLUGIN=1"],
deps = [
":null_lib",
":null_vm_plugin_interface",
"//api/wasm/cpp:intrinsics_hdr",
"//external:abseil_node_hash_map",
"//source/common/common:assert_lib",
"//source/common/common:c_smart_ptr_lib",
"//source/common/protobuf",
"//source/extensions/common/wasm:wasm_hdr",
"//source/extensions/common/wasm:well_known_names",
Expand Down
Loading

0 comments on commit 62fe0e6

Please sign in to comment.