James Kuszmaul | 27da814 | 2019-07-21 16:13:55 -0700 | [diff] [blame^] | 1 | package(default_visibility = ["//visibility:public"]) |
| 2 | |
| 3 | filegroup( |
| 4 | name = "all", |
| 5 | srcs = [ |
| 6 | "emar.sh", |
| 7 | "emcc.sh", |
| 8 | ":emscripten_cache_content", |
| 9 | "@emscripten_clang//:all", |
| 10 | "@emscripten_toolchain//:all", |
| 11 | "@nodejs//:bin/node", |
| 12 | ], |
| 13 | ) |
| 14 | |
| 15 | # TODO(james): There is a set of static files that emscripten will always |
| 16 | # attempt to either rebuild or source from a cache. Ideally, we would make |
| 17 | # the build of these files part of the normal build process; however, the |
| 18 | # emscripten compiler handles sandboxing poorly for these files and so it |
| 19 | # is simplest to just manually run emscripten outside of the sandbox and |
| 20 | # copy over the cache folder for now. |
| 21 | filegroup( |
| 22 | name = "emscripten_cache_content", |
| 23 | srcs = glob(["emscripten_cache/**/*"]), |
| 24 | ) |
| 25 | |
| 26 | cc_toolchain( |
| 27 | name = "cc_emscripten", |
| 28 | all_files = ":all", |
| 29 | compiler_files = ":all", |
| 30 | cpu = "web", |
| 31 | dwp_files = ":empty", |
| 32 | dynamic_runtime_libs = [":empty"], |
| 33 | linker_files = ":all", |
| 34 | objcopy_files = ":empty", |
| 35 | static_runtime_libs = [":empty"], |
| 36 | strip_files = ":empty", |
| 37 | supports_param_files = 0, |
| 38 | ) |