Use emsdk as external bazel dependency (#766)

* Makes provided bazel rules look up @emsdk workspace instead of local workspace
* Uses system-specific emscripten binaries instead of defaulting to linux
* Provides macros for loading emsdk dependencies (nodejs and emscripten binaries)
* Unhardcodes paths in bazel rules and .sh wrappers
* `update_bazel_workspace.sh` now updates `revisions.bzl`
* `emscripten_deps()` can be fed with specific emscripten version
* Adds external usage test

Addresses #650 and #696
This commit is contained in:
Tim Talashok
2021-03-25 00:50:44 +01:00
committed by GitHub
parent fdda8524ce
commit c1589b5564
21 changed files with 333 additions and 100 deletions

View File

@@ -9,9 +9,9 @@ filegroup(
"emcc.sh",
"emscripten_config",
"env.sh",
"@emscripten//:all",
"@nodejs//:node_files",
"@npm//:node_modules",
"@emsdk//:binaries",
"@emsdk//:node_modules",
],
)
@@ -26,7 +26,7 @@ filegroup(
"emcc_link.sh",
"link_wrapper.py",
":common-script-includes",
"@emscripten//:all",
"@emsdk//:binaries",
"@nodejs//:node_files",
],
)
@@ -36,7 +36,7 @@ filegroup(
srcs = [
":compile-emscripten",
":link-emscripten",
"@emscripten//:all",
"@emsdk//:binaries",
"@nodejs//:node_files",
],
)
@@ -49,7 +49,8 @@ cc_library(name = "malloc")
emscripten_cc_toolchain_config_rule(
name = "wasm",
cpu = "wasm",
emscripten_version = "emscripten",
em_config = "emscripten_config",
emscripten_binaries = "@emsdk//:binaries",
)
cc_toolchain(