Skip to content

Commit f260754

Browse files
committed
update README
1 parent 16a7285 commit f260754

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

bazel/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,23 @@ emscripten_cache.targets(targets = [
8888
```
8989

9090
See `test_external/` for an example using [embind](https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html).
91+
92+
Alternatively, you can use the embuilder to build the cache manually and put it into
93+
an archive that you serve from your HTTP server. Then you can declare it in your
94+
`MODULE.bazel` as follows:
95+
96+
```starlark
97+
98+
emscripten_cache = use_extension(
99+
"@emsdk//:emscripten_cache.bzl",
100+
"emscripten_cache",
101+
)
102+
103+
emscripten_cache.prebuilt_cache(
104+
http_archive_url = "https://my-host.com/my-emsdk-cache-4.0.16.tar.gz",
105+
sha256 = "3e88abcbd22bac7b05af416c8f1859d12572c8e9356db604a2768fcfda863da8",
106+
strip_prefix = "my-emsdk-cache",
107+
)
108+
```
109+
110+
You cannot use both `prebuilt_cache` and `configuration`/`targets` at the same time. If you try to do so, `prebuilt_cache` will take precedence.

0 commit comments

Comments
 (0)