[canvaskit] Use closure in release Bazel builds

We don't need to use the env variable EMCC_CLOSURE_ARGS,
as per https://github.com/emscripten-core/emsdk/pull/941

We can use --closure-args to pass the externs file in
instead, which is much easier to configure.

Change-Id: I2dcfbca6307438e76fb374741bb6b33ef296be15
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478307
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
This commit is contained in:
Kevin Lubick 2021-12-01 08:51:58 -05:00
parent 22525afffb
commit aef2b63743

View File

@ -20,9 +20,9 @@ BASE_LINKOPTS = [
]
RELEASE_OPTS = [
# We disable closure for now, because we need a way to pass in the externs file,
# which does not appear to be exposed on the emscripten toolchain.
# "--closure 1", # Run the closure compiler
"--closure 1", # Run the closure compiler
# pass the externs file in
"--closure-args=--externs=modules/canvaskit/externs.js",
"-sASSERTIONS=0", # Turn off assertions
"-Oz",
]
@ -198,7 +198,6 @@ JS_INTERFACE_FILES = [
"color.js",
"cpu.js",
"debug.js",
"externs.js",
"font.js",
"gpu.js",
"interface.js",
@ -246,14 +245,10 @@ CK_SRCS = [
cc_binary_with_flags(
name = "canvaskit_with_flags",
srcs = CK_SRCS,
additional_linker_inputs = JS_INTERFACE_FILES,
additional_linker_inputs = JS_INTERFACE_FILES + ["externs.js"],
# wasm_cc_binary makes the canvaskit.js/canvaskit.wasm based on the actual name
# of the executable.
cc_binary_name = "canvaskit",
features = [
# https://github.com/emscripten-core/emsdk/blob/846f683bea839899164cdbe287f92f7ae952428e/bazel/emscripten_toolchain/crosstool.bzl#L1051
"emcc_debug_link",
],
linkopts = CK_OPTS,
local_defines = CK_DEFINES,
set_flags = {