WASM build cleanups
Fix debugger includes (broke on https://skia-review.googlesource.com/c/skia/+/208226)
Fix canvaskit building w/o fonts
Change-Id: I1279d92ee1ac749a974830e75b41e97e9f75f578
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208515
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 61715a7..d5f43f9 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -472,7 +472,7 @@
}
optional("fontmgr_wasm") {
- enabled = target_cpu == "wasm"
+ enabled = !skia_enable_fontmgr_empty && target_cpu == "wasm"
deps = [
":typeface_freetype",
@@ -1107,6 +1107,7 @@
"include/private",
"src/gpu",
"src/core",
+ "src/sksl",
"src/shaders",
"src/utils",
"tools",
diff --git a/modules/canvaskit/compile.sh b/modules/canvaskit/compile.sh
index 6df90b3..c039022 100755
--- a/modules/canvaskit/compile.sh
+++ b/modules/canvaskit/compile.sh
@@ -98,10 +98,12 @@
HTML_CANVAS_API=""
fi
+GN_FONT="skia_enable_fontmgr_empty=false"
BUILTIN_FONT="$BASE_DIR/fonts/NotoMono-Regular.ttf.cpp"
if [[ $@ == *no_font* ]]; then
echo "Omitting the built-in font(s)"
BUILTIN_FONT=""
+ GN_FONT="skia_enable_fontmgr_empty=true"
else
# Generate the font's binary file (which is covered by .gitignore)
python tools/embed_resources.py \
@@ -173,12 +175,12 @@
\
${GN_SHAPER} \
${GN_GPU} \
+ ${GN_FONT} \
\
skia_enable_skshaper=true \
skia_enable_ccpr=false \
skia_enable_nvpr=false \
skia_enable_skpicture=true \
- skia_enable_fontmgr_empty=false \
skia_enable_pdf=false"
# Build all the libs, we'll link the appropriate ones down below
@@ -191,12 +193,6 @@
# Emscripten prefers that the .a files go last in order, otherwise, it
# may drop symbols that it incorrectly thinks aren't used. One day,
# Emscripten will use LLD, which may relax this requirement.
-#
-# Setting -s USE_WEBGL2=1 does two things:
-# 1. Allows users to try to create a WebGL2 context for use with CanvasKit
-# (this is not supported, only WebGL1 [initially])
-# 2. Makes WebGL1 work better on some graphics cards (for reasons that aren't
-# super clear, but might have to do with extensions).
${EMCXX} \
$RELEASE_CONF \
-Iexperimental \