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>
This commit is contained in:
Kevin Lubick 2018-10-10 14:55:01 -04:00
parent 8505a0a842
commit e805b243f6
2 changed files with 14 additions and 30 deletions

View File

@ -27,7 +27,7 @@ EXTRA_CFLAGS="\"-DSK_RELEASE\""
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 @@ echo "Compiling bitcode"
--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 @@ echo "Compiling bitcode"
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 @@ echo "Compiling bitcode"
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 @@ echo "Generating final wasm"
# 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 @@ ${EMCC} \
-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 @@ ${EMCC} \
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

View File

@ -91,32 +91,13 @@ echo "Compiling bitcode"
./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 @@ ${EMCXX} $RELEASE_CONF -std=c++14 \
-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 @@ $WASM_CONF \
-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