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:
12
bazel/test_external/BUILD
Normal file
12
bazel/test_external/BUILD
Normal file
@@ -0,0 +1,12 @@
|
||||
load("@emsdk//emscripten_toolchain:wasm_rules.bzl", "wasm_cc_binary")
|
||||
|
||||
cc_binary(
|
||||
name = "hello-world",
|
||||
srcs = ["hello-world.cc"],
|
||||
)
|
||||
|
||||
wasm_cc_binary(
|
||||
name = "hello-world-wasm",
|
||||
cc_target = ":hello-world",
|
||||
)
|
||||
|
||||
10
bazel/test_external/WORKSPACE
Normal file
10
bazel/test_external/WORKSPACE
Normal file
@@ -0,0 +1,10 @@
|
||||
local_repository(
|
||||
name = "emsdk",
|
||||
path = "..",
|
||||
)
|
||||
|
||||
load("@emsdk//:deps.bzl", "deps")
|
||||
deps()
|
||||
|
||||
load("@emsdk//:emscripten_deps.bzl", "emscripten_deps")
|
||||
emscripten_deps()
|
||||
6
bazel/test_external/hello-world.cc
Normal file
6
bazel/test_external/hello-world.cc
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
std::cout << "hello world!" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user