Files
mongo/bazel/toolchains/cc/mongo_wasm
Samuel Mercier 9b39ddac21 SERVER-116038 Investigate adding WASI SDK to be used in Bazel (#47863)
GitOrigin-RevId: aad4d9d1777e97293bfb52f064aadfa3145cfe8b
2026-02-12 16:15:38 +00:00
..

Usage

To use the WASI SDK apply the wasi_compatible with a select statement:

    select({
        "//bazel/toolchains/cc/wasm:wasi_compatible": [
            "//bazel/toolchains/cc/wasm/sample:dist_hello_world",
        ],
        "//conditions:default": [],
    })

If your target is defined in terms of a traditional bazel C/C++ target you can use the WASI transition in order to ensure the bazel options are WASI compatible.

load("//bazel/toolchains/cc/wasm/toolchain:with_wasi_config.bzl", "with_wasi_config")
with_wasi_config(
    name = "dist_hello_world",
    srcs = [
        ":hello_world",
    ],
)