diff --git a/bazel/README.md b/bazel/README.md index dc849fd27a..35c40a892e 100644 --- a/bazel/README.md +++ b/bazel/README.md @@ -25,13 +25,16 @@ emsdk_emscripten_deps() Put the following lines into your `.bazelrc`: ``` -build:wasm --crosstool_top=//emscripten_toolchain:everything +build:wasm --crosstool_top=@emsdk//emscripten_toolchain:everything build:wasm --cpu=wasm build:wasm --host_crosstool_top=@bazel_tools//tools/cpp:toolchain ``` -Simply pass `--config=wasm` when building a normal `cc_binary`. The result of -this build will be a tar archive containing any files produced by emscripten. +Simply pass `--config=wasm` when building a normal `cc_binary`, e.g. +``` +bazel build --config=wasm :hello-world +``` +The result of this build will be a tar archive containing any files produced by emscripten. ### Using wasm_cc_binary First, write a new rule wrapping your `cc_binary`. diff --git a/bazel/test_external/.bazelrc b/bazel/test_external/.bazelrc new file mode 100644 index 0000000000..65caa9c974 --- /dev/null +++ b/bazel/test_external/.bazelrc @@ -0,0 +1,3 @@ +build:wasm --crosstool_top=@emsdk//emscripten_toolchain:everything +build:wasm --cpu=wasm +build:wasm --host_crosstool_top=@bazel_tools//tools/cpp:toolchain diff --git a/bazel/test_external/.gitignore b/bazel/test_external/.gitignore new file mode 100644 index 0000000000..ac51a054d2 --- /dev/null +++ b/bazel/test_external/.gitignore @@ -0,0 +1 @@ +bazel-*