Tweak to compile flags
Bug: skia:
Change-Id: I067fa83e1a07b244bec71ed4f95c144dc7e2edc1
Reviewed-on: https://skia-review.googlesource.com/c/161143
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/experimental/canvaskit/compile.sh b/experimental/canvaskit/compile.sh
index f309e20..b84634d 100755
--- a/experimental/canvaskit/compile.sh
+++ b/experimental/canvaskit/compile.sh
@@ -27,7 +27,7 @@
if [[ $@ == *debug* ]]; then
echo "Building a Debug build"
EXTRA_CFLAGS="\"-DSK_DEBUG\""
- RELEASE_CONF="-O0 --js-opts 0 -s SAFE_HEAP=1 -s ASSERTIONS=1 -g3 -DPATHKIT_TESTING -DSK_DEBUG"
+ RELEASE_CONF="-O0 --js-opts 0 -s SAFE_HEAP=1 -s ASSERTIONS=1 -s GL_ASSERTIONS=1 -g3 -DPATHKIT_TESTING -DSK_DEBUG"
fi
# Turn off exiting while we check for ninja (which may not be on PATH)
@@ -47,7 +47,8 @@
--args="cc=\"${EMCC}\" \
cxx=\"${EMCXX}\" \
extra_cflags_cc=[\"-frtti\"] \
- extra_cflags=[\"-s\",\"USE_FREETYPE=1\",\"-s\",\"USE_LIBPNG=1\", \"-DIS_WEBGL=1\",
+ extra_cflags=[\"-s\",\"USE_FREETYPE=1\",\"-s\",\"USE_LIBPNG=1\", \"-s\", \"WARN_UNALIGNED=1\",
+ \"-DIS_WEBGL=1\", \"-DSKNX_NO_SIMD\",
${EXTRA_CFLAGS}
] \
is_debug=false \
@@ -55,10 +56,10 @@
is_component_build=false \
target_cpu=\"wasm\" \
\
+ skia_use_angle = false \
skia_use_dng_sdk=false \
skia_use_egl=true \
skia_use_expat=false \
- skia_use_expat=false \
skia_use_fontconfig=false \
skia_use_freetype=true \
skia_use_icu=false \
@@ -69,7 +70,6 @@
skia_use_lua=false \
skia_use_piex=false \
skia_use_vulkan=false \
- skia_use_vulkan=false \
skia_use_zlib=true \
\
skia_enable_gpu=true \
@@ -84,7 +84,7 @@
# Skottie doesn't end up in libskia and is currently not its own library
# so we just hack in the .cpp files we need for now.
-${EMCC} \
+${EMCXX} \
$RELEASE_CONF \
-Iinclude/c \
-Iinclude/codec \
@@ -105,7 +105,7 @@
-Itools \
-lEGL \
-lGLESv2 \
- -std=c++11 \
+ -std=c++14 \
--bind \
--pre-js $BASE_DIR/helper.js \
--pre-js $BASE_DIR/interface.js \
@@ -131,13 +131,14 @@
src/utils/SkJSON.cpp \
src/utils/SkParse.cpp \
-s ALLOW_MEMORY_GROWTH=1 \
- -s TOTAL_MEMORY=64MB \
-s EXPORT_NAME="CanvasKitInit" \
-s FORCE_FILESYSTEM=0 \
-s MODULARIZE=1 \
-s NO_EXIT_RUNTIME=1 \
-s STRICT=1 \
+ -s TOTAL_MEMORY=32MB \
-s USE_FREETYPE=1 \
-s USE_LIBPNG=1 \
+ -s WARN_UNALIGNED=1 \
-s WASM=1 \
-o $BUILD_DIR/canvaskit.js
diff --git a/modules/pathkit/compile.sh b/modules/pathkit/compile.sh
index 26e6438..6f1e0c2 100755
--- a/modules/pathkit/compile.sh
+++ b/modules/pathkit/compile.sh
@@ -91,32 +91,13 @@
./bin/gn gen ${BUILD_DIR} \
--args="cc=\"${EMCC}\" \
cxx=\"${EMCXX}\" \
- extra_cflags=[\"-DSK_DISABLE_READBUFFER=1\",${EXTRA_CFLAGS}] \
+ extra_cflags=[\"-DSK_DISABLE_READBUFFER=1\",\"-s\", \"WARN_UNALIGNED=1\",
+ ${EXTRA_CFLAGS}
+ ] \
is_debug=false \
is_official_build=true \
is_component_build=false \
- target_cpu=\"wasm\" \
- \
- skia_use_egl=false \
- skia_use_vulkan=false \
- skia_use_libwebp=false \
- skia_use_libpng=false \
- skia_use_lua=false \
- skia_use_dng_sdk=false \
- skia_use_fontconfig=false \
- skia_use_libjpeg_turbo=false \
- skia_use_libheif=false \
- skia_use_expat=false \
- skia_use_vulkan=false \
- skia_use_freetype=false \
- skia_use_icu=false \
- skia_use_expat=false \
- skia_use_piex=false \
- skia_use_zlib=false \
- \
- skia_enable_gpu=false \
- skia_enable_fontmgr_empty=true \
- skia_enable_pdf=false"
+ target_cpu=\"wasm\" "
${NINJA} -C ${BUILD_DIR} libpathkit.a
@@ -135,6 +116,7 @@
-Isrc/shaders \
-Isrc/opts \
-Isrc/utils \
+-std=c++14 \
--bind \
--pre-js $BASE_DIR/helper.js \
--pre-js $BASE_DIR/chaining.js \
@@ -149,6 +131,7 @@
-s NO_EXIT_RUNTIME=1 \
-s NO_FILESYSTEM=1 \
-s STRICT=1 \
+-s WARN_UNALIGNED=1 \
$OUTPUT \
$BASE_DIR/pathkit_wasm_bindings.cpp \
${BUILD_DIR}/libpathkit.a