skia2/experimental/wasm-hello-world/BUILD.bazel
Kevin Lubick 048545d249 Set up basic hello world sk_app
Change-Id: I233e7653eadcce87067def841b2f28c700f96045
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492096
Reviewed-by: Brian Salomon <bsalomon@google.com>
2022-01-06 20:29:35 +00:00

45 lines
1.1 KiB
Python

load("@emsdk//emscripten_toolchain:wasm_rules.bzl", "wasm_cc_binary")
load("//bazel:cc_binary_with_flags.bzl", "cc_binary_with_flags")
LINKOPTS = [
"-sALLOW_MEMORY_GROWTH",
"-sUSE_PTHREADS=0", # Disable pthreads
"-sMODULARIZE",
"-sDISABLE_EXCEPTION_CATCHING", # Disable all exception catching
"-sWASM",
"-sMAX_WEBGL_VERSION=2",
"-sFORCE_FILESYSTEM=0",
"-sFILESYSTEM=0",
"-sASSERTIONS", # Turn on assertions
"-sGL_ASSERTIONS",
"-sEXPORT_NAME=HelloWorld",
]
cc_binary_with_flags(
name = "hello_world.webgl",
srcs = [
"//example:HelloWorld_src",
"//tools/sk_app/wasm:main_wasm_src",
],
linkopts = LINKOPTS,
set_flags = {
"gpu_backend": [
"gl_backend",
],
"with_gl_standard": [
"webgl_standard",
],
},
# This target won't build successfully on its own because of missing emscripten
# headers etc. Therefore, we hide it from wildcards.
tags = ["manual"],
deps = [
"//:skia_core",
],
)
wasm_cc_binary(
name = "hello_world_wasm",
cc_target = ":hello_world.webgl",
)