Skip to content

Commit 3683d4e

Browse files
committed
Add a WebAssembly toolchain to tests/WORKSPACE
1 parent f8d7c85 commit 3683d4e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/WORKSPACE

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,38 @@ llvm_toolchain(
156156
urls = {"": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz"]},
157157
)
158158

159+
# Toolchain example for WebAssembly.
160+
llvm_toolchain(
161+
name = "llvm_toolchain_wasm",
162+
# WebAssembly tests use a separate (newer) version of LLVM to exercise
163+
# support for experimental features such as wasm64.
164+
llvm_versions = {
165+
# The most recent LLVM as of 2024-10-17
166+
"": "19.1.0",
167+
},
168+
sysroot = {
169+
"wasm32": "@wasi_sdk_sysroots//wasm32-wasip2",
170+
"wasm64": "@wasi_sdk_sysroots//empty",
171+
},
172+
stdlib = {
173+
"wasm32": "libc",
174+
"wasm64": "none",
175+
},
176+
libclang_rt = {
177+
"@libclang_rt_wasm32//:libclang_rt.builtins-wasm32.a": "wasm32-unknown-unknown/libclang_rt.builtins.a",
178+
},
179+
)
180+
181+
load(
182+
"@llvm_toolchain_wasm//:toolchains.bzl",
183+
llvm_register_toolchains_wasm = "llvm_register_toolchains",
184+
)
185+
llvm_register_toolchains_wasm()
186+
187+
load("//wasm:wasi_sdk.bzl", "libclang_rt_wasm32", "wasi_sdk_sysroots")
188+
libclang_rt_wasm32(name = "libclang_rt_wasm32")
189+
wasi_sdk_sysroots(name = "wasi_sdk_sysroots")
190+
159191
## Test dependencies.
160192

161193
# Well known repos; present here only for testing.

0 commit comments

Comments
 (0)