Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
run: |
bazel run //bazel/cargo/wasmsign:crates_vendor
bazel run //bazel/cargo/wasmtime:crates_vendor
perl -pi -e 's/rust_library/rust_static_library/g' bazel/cargo/wasmtime/remote/BUILD.wasmtime-c-api-impl-*.bazel
git diff --exit-code
clang_format:
Expand Down
62 changes: 1 addition & 61 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ cc_library(
name = "wasmtime_lib",
srcs = [
"src/common/types.h",
"src/wasmtime/types.h",
"src/wasmtime/wasmtime.cc",
],
hdrs = ["include/proxy-wasm/wasmtime.h"],
Expand All @@ -201,6 +200,7 @@ cc_library(
"PROXY_WASM_HAS_RUNTIME_WASMTIME",
"PROXY_WASM_HOST_ENGINE_WASMTIME",
],
includes = ["@com_github_bytecodealliance_wasmtime//:wasmtime_lib"],
# See: https://bytecodealliance.github.io/wasmtime/c-api/
linkopts = select({
"@platforms//os:macos": [],
Expand All @@ -225,65 +225,6 @@ cc_library(
],
)

genrule(
name = "prefixed_wasmtime_sources",
srcs = [
"src/wasmtime/types.h",
"src/wasmtime/wasmtime.cc",
],
outs = [
"src/wasmtime/prefixed_types.h",
"src/wasmtime/prefixed_wasmtime.cc",
],
cmd = """
for file in $(SRCS); do
sed -e 's/wasm_/wasmtime_wasm_/g' \
-e 's/include\\/wasm.h/include\\/prefixed_wasm.h/g' \
-e 's/wasmtime\\/types.h/wasmtime\\/prefixed_types.h/g' \
$$file >$(@D)/$$(dirname $$file)/prefixed_$$(basename $$file)
done
""",
)

cc_library(
name = "prefixed_wasmtime_lib",
srcs = [
"src/common/types.h",
"src/wasmtime/prefixed_types.h",
"src/wasmtime/prefixed_wasmtime.cc",
],
hdrs = ["include/proxy-wasm/wasmtime.h"],
copts = [
"-DWASM_API_EXTERN=",
],
defines = [
"PROXY_WASM_HAS_RUNTIME_WASMTIME",
"PROXY_WASM_HOST_ENGINE_WASMTIME",
],
# See: https://bytecodealliance.github.io/wasmtime/c-api/
linkopts = select({
"@platforms//os:macos": [],
"@platforms//os:windows": [
"ws2_32.lib",
"advapi32.lib",
"userenv.lib",
"ntdll.lib",
"shell32.lib",
"ole32.lib",
"bcrypt.lib",
],
"//conditions:default": [
"-ldl",
"-lm",
"-lpthread",
],
}),
deps = [
":wasm_vm_headers",
"@com_github_bytecodealliance_wasmtime//:prefixed_wasmtime_lib",
],
)

cc_library(
name = "lib",
deps = [
Expand All @@ -298,6 +239,5 @@ cc_library(
[":wasmedge_lib"],
) + proxy_wasm_select_engine_wasmtime(
[":wasmtime_lib"],
[":prefixed_wasmtime_lib"],
),
)
Loading
Loading