[canvaskit] Disable dynamic execution
This required an update to emscripten, due to there being a few bug fixes regarding the non-dynamic code and the Closure compiler/minifier. Change-Id: Icc922bd98cdd52a6923a9367da3747dac2b897b3 Bug: skia:12795 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492916 Reviewed-by: Nathaniel Nifong <nifong@google.com>
This commit is contained in:
parent
1def701690
commit
102dbf9c43
@ -69,7 +69,7 @@ fi
|
||||
if [[ $@ == *debug* ]]; then
|
||||
echo "Building a *${BUILD_TYPE}* Debug build"
|
||||
EXTRA_CFLAGS="\"-DSK_DEBUG\""
|
||||
RELEASE_CONF="-O0 --js-opts 0 -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=1 -s GL_ASSERTIONS=1 -g4 \
|
||||
RELEASE_CONF="-O0 --js-opts 0 -sDEMANGLE_SUPPORT=1 -sASSERTIONS=1 -sGL_ASSERTIONS=1 -g4 \
|
||||
--source-map-base /bin/ -DSK_DEBUG --pre-js $BASE_DIR/debug.js"
|
||||
BUILD_DIR=${BUILD_DIR:="out/skottiekit_debug"}
|
||||
elif [[ $@ == *profiling* ]]; then
|
||||
@ -89,12 +89,12 @@ GN_GPU="skia_enable_gpu=true skia_gl_standard = \"webgl\""
|
||||
GN_GPU_FLAGS="\"-DSK_DISABLE_LEGACY_SHADERCONTEXT\","
|
||||
WASM_GPU="-lEGL -lGL -lGLESv2 -DSK_SUPPORT_GPU=1 -DSK_GL \
|
||||
-DSK_DISABLE_LEGACY_SHADERCONTEXT --pre-js $BASE_DIR/cpu.js --pre-js $BASE_DIR/gpu.js\
|
||||
-s USE_WEBGL2=1"
|
||||
-sUSE_WEBGL2=1"
|
||||
if [[ $@ == *cpu* ]]; then
|
||||
echo "Using the CPU backend instead of the GPU backend"
|
||||
GN_GPU="skia_enable_gpu=false"
|
||||
GN_GPU_FLAGS=""
|
||||
WASM_GPU="-DSK_SUPPORT_GPU=0 --pre-js $BASE_DIR/cpu.js -s USE_WEBGL2=0"
|
||||
WASM_GPU="-DSK_SUPPORT_GPU=0 --pre-js $BASE_DIR/cpu.js -sUSE_WEBGL2=0"
|
||||
fi
|
||||
|
||||
SKOTTIE_LIB="$BUILD_DIR/libskottie.a \
|
||||
@ -129,7 +129,7 @@ echo "Compiling bitcode"
|
||||
cxx=\"${EMCXX}\" \
|
||||
ar=\"${EMAR}\" \
|
||||
extra_cflags_cc=[\"-frtti\"] \
|
||||
extra_cflags=[\"-s\", \"WARN_UNALIGNED=1\", \"-s\", \"MAIN_MODULE=1\",
|
||||
extra_cflags=[\"-sMAIN_MODULE=1\",
|
||||
\"-DSKNX_NO_SIMD\", \"-DSK_DISABLE_AAA\",
|
||||
\"-DSK_DISABLE_EFFECT_DESERIALIZATION\",
|
||||
\"-DSK_FORCE_8_BYTE_ALIGNMENT\",
|
||||
@ -196,14 +196,13 @@ ${EMCXX} \
|
||||
$BUILD_DIR/libsksg.a \
|
||||
$BUILD_DIR/libskshaper.a \
|
||||
$BUILD_DIR/libskia.a \
|
||||
-s ALLOW_MEMORY_GROWTH=1 \
|
||||
-s EXPORT_NAME="SkottieKitInit" \
|
||||
-s FORCE_FILESYSTEM=0 \
|
||||
-s FILESYSTEM=0 \
|
||||
-s MODULARIZE=1 \
|
||||
-s NO_EXIT_RUNTIME=1 \
|
||||
-s STRICT=1 \
|
||||
-s INITIAL_MEMORY=128MB \
|
||||
-s WARN_UNALIGNED=1 \
|
||||
-s WASM=1 \
|
||||
-sALLOW_MEMORY_GROWTH=1 \
|
||||
-sEXPORT_NAME="SkottieKitInit" \
|
||||
-sFORCE_FILESYSTEM=0 \
|
||||
-sFILESYSTEM=0 \
|
||||
-sMODULARIZE=1 \
|
||||
-sNO_EXIT_RUNTIME=1 \
|
||||
-sSTRICT=1 \
|
||||
-sINITIAL_MEMORY=128MB \
|
||||
-sWASM=1 \
|
||||
-o $BUILD_DIR/skottiekit.js
|
||||
|
@ -25,7 +25,7 @@ EMAR=`which emar`
|
||||
if [[ $@ == *debug* ]]; then
|
||||
echo "Building a Debug build"
|
||||
EXTRA_CFLAGS="\"-DSK_DEBUG\","
|
||||
RELEASE_CONF="-O0 --js-opts 0 -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=1 -s GL_ASSERTIONS=1 -g3 \
|
||||
RELEASE_CONF="-O0 --js-opts 0 -sDEMANGLE_SUPPORT=1 -sASSERTIONS=1 -sGL_ASSERTIONS=1 -g3 \
|
||||
--source-map-base /node_modules/debugger/bin/ -DSK_DEBUG"
|
||||
BUILD_DIR=${BUILD_DIR:="out/debugger_wasm_debug"}
|
||||
else
|
||||
@ -70,7 +70,7 @@ echo "Compiling bitcode"
|
||||
cxx=\"${EMCXX}\" \
|
||||
ar=\"${EMAR}\" \
|
||||
extra_cflags_cc=[\"-frtti\"] \
|
||||
extra_cflags=[\"-s\", \"MAIN_MODULE=1\",
|
||||
extra_cflags=[\"-sMAIN_MODULE=1\",
|
||||
\"-DSKNX_NO_SIMD\", \"-DSK_DISABLE_AAA\",
|
||||
\"-DSK_FORCE_8_BYTE_ALIGNMENT\",
|
||||
\"-DSK_ENABLE_DUMP_GPU\", \"-DSK_DISABLE_LEGACY_SHADERCONTEXT\",
|
||||
@ -140,14 +140,14 @@ EMCC_DEBUG=1 ${EMCXX} \
|
||||
$BASE_DIR/debugger_bindings.cpp \
|
||||
$BUILD_DIR/libdebugcanvas.a \
|
||||
$BUILD_DIR/libskia.a \
|
||||
-s ALLOW_MEMORY_GROWTH=1 \
|
||||
-s EXPORT_NAME="DebuggerInit" \
|
||||
-s FORCE_FILESYSTEM=0 \
|
||||
-s FILESYSTEM=0 \
|
||||
-s MODULARIZE=1 \
|
||||
-s NO_EXIT_RUNTIME=1 \
|
||||
-s STRICT=1 \
|
||||
-s INITIAL_MEMORY=128MB \
|
||||
-s WASM=1 \
|
||||
-s USE_WEBGL2=1 \
|
||||
-sALLOW_MEMORY_GROWTH=1 \
|
||||
-sEXPORT_NAME="DebuggerInit" \
|
||||
-sFORCE_FILESYSTEM=0 \
|
||||
-sFILESYSTEM=0 \
|
||||
-sMODULARIZE=1 \
|
||||
-sNO_EXIT_RUNTIME=1 \
|
||||
-sSTRICT=1 \
|
||||
-sINITIAL_MEMORY=128MB \
|
||||
-sWASM=1 \
|
||||
-sUSE_WEBGL2=1 \
|
||||
-o $BUILD_DIR/debugger.js
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
DOCKER_IMAGE = 'gcr.io/skia-public/canvaskit-emsdk:2.0.20_v1'
|
||||
DOCKER_IMAGE = 'gcr.io/skia-public/canvaskit-emsdk:3.1.3_v1'
|
||||
INNER_BUILD_SCRIPT = '/SRC/skia/infra/canvaskit/build_canvaskit.sh'
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
"[START_DIR]/cache/work:/SRC",
|
||||
"--volume",
|
||||
"[START_DIR]/cache/docker/pathkit:/OUT",
|
||||
"gcr.io/skia-public/emsdk-base:2.0.20_v1",
|
||||
"gcr.io/skia-public/emsdk-base:3.1.3_v1",
|
||||
"/SRC/skia/infra/pathkit/build_pathkit.sh",
|
||||
"debug",
|
||||
"asm.js"
|
||||
|
@ -23,7 +23,7 @@
|
||||
"[START_DIR]/cache/work:/SRC",
|
||||
"--volume",
|
||||
"[START_DIR]/cache/docker/pathkit:/OUT",
|
||||
"gcr.io/skia-public/emsdk-base:2.0.20_v1",
|
||||
"gcr.io/skia-public/emsdk-base:3.1.3_v1",
|
||||
"/SRC/skia/infra/pathkit/build_pathkit.sh",
|
||||
"asm.js"
|
||||
],
|
||||
|
@ -23,7 +23,7 @@
|
||||
"[START_DIR]/cache/work:/SRC",
|
||||
"--volume",
|
||||
"[START_DIR]/cache/docker/canvaskit:/OUT",
|
||||
"gcr.io/skia-public/canvaskit-emsdk:2.0.20_v1",
|
||||
"gcr.io/skia-public/canvaskit-emsdk:3.1.3_v1",
|
||||
"/SRC/skia/infra/canvaskit/build_canvaskit.sh",
|
||||
"debug"
|
||||
],
|
||||
|
@ -23,7 +23,7 @@
|
||||
"[START_DIR]/cache/work:/SRC",
|
||||
"--volume",
|
||||
"[START_DIR]/cache/docker/pathkit:/OUT",
|
||||
"gcr.io/skia-public/emsdk-base:2.0.20_v1",
|
||||
"gcr.io/skia-public/emsdk-base:3.1.3_v1",
|
||||
"/SRC/skia/infra/pathkit/build_pathkit.sh",
|
||||
"debug"
|
||||
],
|
||||
|
@ -23,7 +23,7 @@
|
||||
"[START_DIR]/cache/work:/SRC",
|
||||
"--volume",
|
||||
"[START_DIR]/cache/docker/canvaskit:/OUT",
|
||||
"gcr.io/skia-public/canvaskit-emsdk:2.0.20_v1",
|
||||
"gcr.io/skia-public/canvaskit-emsdk:3.1.3_v1",
|
||||
"/SRC/skia/infra/canvaskit/build_canvaskit.sh",
|
||||
"cpu"
|
||||
],
|
||||
|
@ -23,7 +23,7 @@
|
||||
"[START_DIR]/cache/work:/SRC",
|
||||
"--volume",
|
||||
"[START_DIR]/cache/docker/pathkit:/OUT",
|
||||
"gcr.io/skia-public/emsdk-base:2.0.20_v1",
|
||||
"gcr.io/skia-public/emsdk-base:3.1.3_v1",
|
||||
"/SRC/skia/infra/pathkit/build_pathkit.sh"
|
||||
],
|
||||
"env": {
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
DOCKER_IMAGE = 'gcr.io/skia-public/emsdk-base:2.0.20_v1'
|
||||
DOCKER_IMAGE = 'gcr.io/skia-public/emsdk-base:3.1.3_v1'
|
||||
INNER_BUILD_SCRIPT = '/SRC/skia/infra/pathkit/build_pathkit.sh'
|
||||
|
||||
def compile_fn(api, checkout_root, _ignore):
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"go.skia.org/infra/task_driver/go/td"
|
||||
)
|
||||
|
||||
const dockerImage = "gcr.io/skia-public/canvaskit-emsdk:2.0.10_v2"
|
||||
const dockerImage = "gcr.io/skia-public/canvaskit-emsdk:3.1.3_v1"
|
||||
const innerBuildScript = "/SRC/infra/canvaskit/build_gmtests.sh"
|
||||
|
||||
func main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
EMSDK_VERSION=2.0.20_v1
|
||||
EMSDK_VERSION=3.1.3_v1
|
||||
|
||||
publish_canvaskit_emsdk:
|
||||
docker build -t canvaskit-emsdk ./canvaskit-emsdk/
|
||||
|
@ -1,7 +1,7 @@
|
||||
# A Docker image that augments the Emscripten SDK Docker image
|
||||
# with anything needed to build Canvaskit
|
||||
# with anything needed to build CanvasKit
|
||||
|
||||
FROM gcr.io/skia-public/emsdk-base:2.0.20_v1
|
||||
FROM gcr.io/skia-public/emsdk-base:3.1.3_v1
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
|
||||
libfreetype6-dev
|
||||
|
@ -1,4 +1,4 @@
|
||||
EMSDK_VERSION=2.0.20_v1
|
||||
EMSDK_VERSION=3.1.3_v1
|
||||
|
||||
# Can check CHROME_VERSION with
|
||||
# docker run karma-chrome-tests /usr/bin/google-chrome-stable --version
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM emscripten/emsdk:2.0.20
|
||||
FROM emscripten/emsdk:3.1.3
|
||||
|
||||
RUN apt update && apt install -y python
|
||||
|
||||
|
@ -16,6 +16,7 @@ BASE_LINKOPTS = [
|
||||
"-sWASM",
|
||||
"-sMAX_WEBGL_VERSION=2",
|
||||
"-sFORCE_FILESYSTEM=0",
|
||||
"-sDYNAMIC_EXECUTION=0",
|
||||
"-sFILESYSTEM=0",
|
||||
]
|
||||
|
||||
|
@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Surface factories always produce a surface with an attached color space. Specifying `null` to
|
||||
`CanvasKit.MakeWebGLCanvasSurface` or calling any factory that does not take a color space
|
||||
will now create a surface with a color space of `CanvasKit.ColorSpace.SRGB`.
|
||||
- We now build/ship with emscripten 3.1.3.
|
||||
- Internal calls no longer use dynamic dispatch (skbug.com/12795).
|
||||
|
||||
### Fixed
|
||||
- Supplying textures via `Surface.makeImageFromTextureSource` should not cause issues with
|
||||
|
@ -15,8 +15,8 @@ is reasonable.
|
||||
|
||||
Be sure to both install **and** activate the correct version. For example:
|
||||
```
|
||||
./emsdk install 2.0.20
|
||||
./emsdk activate 2.0.20
|
||||
./emsdk install 3.1.3
|
||||
./emsdk activate 3.1.3
|
||||
```
|
||||
|
||||
This document also assumes you have followed the instructions to download Skia and its deps
|
||||
@ -61,13 +61,13 @@ make debug
|
||||
make test-continuous
|
||||
```
|
||||
|
||||
This reads karma.conf.js, and opens a chrome browser and begins running all the test
|
||||
This reads karma.conf.js, and opens a Chrome browser and begins running all the test
|
||||
in `test/` it will detect changes to the tests in that directory and automatically
|
||||
run again, however it will automatically rebuild and reload canvaskit. Closing the
|
||||
run again, however it will automatically rebuild and reload CanvasKit. Closing the
|
||||
chrome window will just cause it to re-opened. Kill the karma process to stop continuous
|
||||
monitoring for changes.
|
||||
|
||||
The tests are run with whichever build of canvaskit you last made. be sure to also
|
||||
The tests are run with whichever build of CanvasKit you last made. be sure to also
|
||||
test with `release`, `debug_cpu`, and `release_cpu`. testing with release builds will
|
||||
expose problems in closure compilation and usually forgotten externs.
|
||||
|
||||
@ -95,7 +95,7 @@ head.
|
||||
|
||||
## Testing from Gerrit
|
||||
|
||||
When submitting a CL in gerrit, click "choose tryjobs" and type canvaskit to filter them.
|
||||
When submitting a CL in gerrit, click "choose tryjobs" and type CanvasKit to filter them.
|
||||
select all of them, which at the time of this writing is four jobs, for each combination
|
||||
of perf/test gpu/cpu.
|
||||
|
||||
|
@ -39,7 +39,7 @@ fi
|
||||
if [[ $@ == *debug* ]]; then
|
||||
echo "Building a Debug build"
|
||||
EXTRA_CFLAGS="\"-DSK_DEBUG\","
|
||||
RELEASE_CONF="-O0 --js-opts 0 -s DEMANGLE_SUPPORT=1 -s ASSERTIONS=1 -s GL_ASSERTIONS=1 -g3 \
|
||||
RELEASE_CONF="-O0 --js-opts 0 -sDEMANGLE_SUPPORT=1 -sASSERTIONS=1 -sGL_ASSERTIONS=1 -g3 \
|
||||
--source-map-base /node_modules/canvaskit/bin/ -DSK_DEBUG --pre-js $BASE_DIR/debug.js"
|
||||
BUILD_DIR=${BUILD_DIR:="out/canvaskit_wasm_debug"}
|
||||
elif [[ $@ == *profiling* ]]; then
|
||||
@ -67,12 +67,12 @@ GN_GPU="skia_enable_gpu=true skia_gl_standard = \"webgl\""
|
||||
GN_GPU_FLAGS="\"-DSK_DISABLE_LEGACY_SHADERCONTEXT\","
|
||||
WASM_GPU="-lGL -DSK_SUPPORT_GPU=1 -DSK_GL \
|
||||
-DSK_DISABLE_LEGACY_SHADERCONTEXT --pre-js $BASE_DIR/cpu.js --pre-js $BASE_DIR/gpu.js\
|
||||
-s USE_WEBGL2=1"
|
||||
-sUSE_WEBGL2=1"
|
||||
if [[ $@ == *cpu* ]]; then
|
||||
echo "Using the CPU backend instead of the GPU backend"
|
||||
GN_GPU="skia_enable_gpu=false"
|
||||
GN_GPU_FLAGS=""
|
||||
WASM_GPU="-DSK_SUPPORT_GPU=0 -DSK_ENABLE_SKSL --pre-js $BASE_DIR/cpu.js -s USE_WEBGL2=0"
|
||||
WASM_GPU="-DSK_SUPPORT_GPU=0 -DSK_ENABLE_SKSL --pre-js $BASE_DIR/cpu.js -sUSE_WEBGL2=0"
|
||||
fi
|
||||
|
||||
SKP_JS="--pre-js $BASE_DIR/skp.js"
|
||||
@ -285,7 +285,7 @@ echo "Compiling bitcode"
|
||||
--args="cc=\"${EMCC}\" \
|
||||
cxx=\"${EMCXX}\" \
|
||||
ar=\"${EMAR}\" \
|
||||
extra_cflags=[\"-s\", \"WARN_UNALIGNED=1\", \"-s\", \"MAIN_MODULE=1\",
|
||||
extra_cflags=[\"-s\", \"MAIN_MODULE=1\",
|
||||
\"-DSKNX_NO_SIMD\", \"-DSK_DISABLE_AAA\",
|
||||
\"-DSK_FORCE_8_BYTE_ALIGNMENT\",
|
||||
${GN_GPU_FLAGS}
|
||||
@ -344,14 +344,6 @@ export EMCC_CLOSURE_ARGS="--externs $BASE_DIR/externs.js "
|
||||
|
||||
echo "Generating final wasm"
|
||||
|
||||
# Disable '-s STRICT=1' outside of Linux until
|
||||
# https://github.com/emscripten-core/emscripten/issues/12118 is resovled.
|
||||
STRICTNESS="-s STRICT=1"
|
||||
if [[ `uname` != "Linux" ]]; then
|
||||
echo "Disabling '-s STRICT=1'. See: https://github.com/emscripten-core/emscripten/issues/12118"
|
||||
STRICTNESS=""
|
||||
fi
|
||||
|
||||
# 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.
|
||||
@ -403,15 +395,16 @@ EMCC_DEBUG=1 ${EMCXX} \
|
||||
$SHAPER_LIB \
|
||||
$BUILD_DIR/libskia.a \
|
||||
$BUILTIN_FONT \
|
||||
-s LLD_REPORT_UNDEFINED \
|
||||
-s ALLOW_MEMORY_GROWTH=1 \
|
||||
-s EXPORT_NAME="CanvasKitInit" \
|
||||
-s EXPORTED_FUNCTIONS=['_malloc','_free'] \
|
||||
-s FORCE_FILESYSTEM=0 \
|
||||
-s FILESYSTEM=0 \
|
||||
-s MODULARIZE=1 \
|
||||
-s NO_EXIT_RUNTIME=1 \
|
||||
-s INITIAL_MEMORY=128MB \
|
||||
-s WASM=1 \
|
||||
$STRICTNESS \
|
||||
-sLLD_REPORT_UNDEFINED \
|
||||
-sALLOW_MEMORY_GROWTH=1 \
|
||||
-sEXPORT_NAME="CanvasKitInit" \
|
||||
-sEXPORTED_FUNCTIONS=['_malloc','_free'] \
|
||||
-sFORCE_FILESYSTEM=0 \
|
||||
-sFILESYSTEM=0 \
|
||||
-sMODULARIZE=1 \
|
||||
-sNO_EXIT_RUNTIME=1 \
|
||||
-sDYNAMIC_EXECUTION=0 \
|
||||
-sINITIAL_MEMORY=128MB \
|
||||
-sWASM=1 \
|
||||
-sSTRICT=1 \
|
||||
-o $BUILD_DIR/canvaskit.js
|
||||
|
@ -29,7 +29,7 @@ if [[ $@ == *debug* ]]; then
|
||||
echo "Building a Debug build"
|
||||
DEBUG=true
|
||||
EXTRA_CFLAGS="\"-DSK_DEBUG\", \"-DGR_TEST_UTILS\", "
|
||||
RELEASE_CONF="-O1 --js-opts 0 -s DEMANGLE_SUPPORT=1 -frtti -s ASSERTIONS=1 -s GL_ASSERTIONS=1 -g \
|
||||
RELEASE_CONF="-O1 --js-opts 0 -sDEMANGLE_SUPPORT=1 -frtti -sASSERTIONS=1 -sGL_ASSERTIONS=1 -g \
|
||||
-DSK_DEBUG --pre-js $BASE_DIR/debug.js"
|
||||
BUILD_DIR=${BUILD_DIR:="out/wasm_gm_tests_debug"}
|
||||
else
|
||||
@ -52,7 +52,7 @@ GN_GPU="skia_enable_gpu=true skia_gl_standard = \"webgl\""
|
||||
GN_GPU_FLAGS="\"-DSK_DISABLE_LEGACY_SHADERCONTEXT\","
|
||||
WASM_GPU="-lGL -DSK_SUPPORT_GPU=1 -DSK_GL \
|
||||
-DSK_DISABLE_LEGACY_SHADERCONTEXT --pre-js $BASE_DIR/cpu.js --pre-js $BASE_DIR/gpu.js\
|
||||
-s USE_WEBGL2=1"
|
||||
-sUSE_WEBGL2=1"
|
||||
|
||||
GM_LIB="$BUILD_DIR/libgm_wasm.a"
|
||||
|
||||
@ -89,7 +89,7 @@ echo "Compiling bitcode"
|
||||
cxx=\"${EMCXX}\" \
|
||||
ar=\"${EMAR}\" \
|
||||
extra_cflags_cc=[\"-frtti\"] \
|
||||
extra_cflags=[\"-s\", \"WARN_UNALIGNED=1\", \"-s\", \"MAIN_MODULE=1\",
|
||||
extra_cflags=[\"-sMAIN_MODULE=1\",
|
||||
\"-DSKNX_NO_SIMD\", \"-DSK_DISABLE_AAA\",
|
||||
\"-DSK_FORCE_8_BYTE_ALIGNMENT\",
|
||||
${GN_GPU_FLAGS}
|
||||
@ -161,14 +161,6 @@ SKIA_DEFINES="
|
||||
-DSK_UNICODE_AVAILABLE \
|
||||
-DSK_ENABLE_SVG"
|
||||
|
||||
# Disable '-s STRICT=1' outside of Linux until
|
||||
# https://github.com/emscripten-core/emscripten/issues/12118 is resovled.
|
||||
STRICTNESS="-s STRICT=1"
|
||||
if [[ `uname` != "Linux" ]]; then
|
||||
echo "Disabling '-s STRICT=1'. See: https://github.com/emscripten-core/emscripten/issues/12118"
|
||||
STRICTNESS=""
|
||||
fi
|
||||
|
||||
GMS_TO_BUILD="gm/*.cpp"
|
||||
TESTS_TO_BUILD="tests/*.cpp"
|
||||
|
||||
@ -234,15 +226,15 @@ EMCC_DEBUG=1 ${EMCXX} \
|
||||
$BUILD_DIR/libsvg.a \
|
||||
$BUILD_DIR/libskia.a \
|
||||
$BUILTIN_FONT \
|
||||
-s LLD_REPORT_UNDEFINED \
|
||||
-s ALLOW_MEMORY_GROWTH=1 \
|
||||
-s EXPORT_NAME="InitWasmGMTests" \
|
||||
-s EXPORTED_FUNCTIONS=['_malloc','_free'] \
|
||||
-s FORCE_FILESYSTEM=1 \
|
||||
-s FILESYSTEM=1 \
|
||||
-s MODULARIZE=1 \
|
||||
-s NO_EXIT_RUNTIME=1 \
|
||||
-s INITIAL_MEMORY=256MB \
|
||||
-s WASM=1 \
|
||||
$STRICTNESS \
|
||||
-sLLD_REPORT_UNDEFINED \
|
||||
-sALLOW_MEMORY_GROWTH=1 \
|
||||
-sEXPORT_NAME="InitWasmGMTests" \
|
||||
-sEXPORTED_FUNCTIONS=['_malloc','_free'] \
|
||||
-sFORCE_FILESYSTEM=1 \
|
||||
-sFILESYSTEM=1 \
|
||||
-sMODULARIZE=1 \
|
||||
-sNO_EXIT_RUNTIME=1 \
|
||||
-sINITIAL_MEMORY=256MB \
|
||||
-sWASM=1 \
|
||||
-sSTRICT=1 \
|
||||
-o $BUILD_DIR/wasm_gm_tests.js
|
||||
|
@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- Now compile with emsdk 2.0.20
|
||||
- Now compile with emsdk 3.1.3
|
||||
- Internal calls no longer use dynamic dispatch (skbug.com/12795)
|
||||
|
||||
## [0.7.0] 2019-07-20
|
||||
|
||||
|
@ -49,7 +49,7 @@ fi
|
||||
# Use -O0 for larger builds (but generally quicker)
|
||||
# Use -Oz for (much slower, but smaller/faster) production builds
|
||||
export EMCC_CLOSURE_ARGS="--externs $BASE_DIR/externs.js "
|
||||
RELEASE_CONF="-Oz --closure 1 -s EVAL_CTORS=1 -DSK_RELEASE"
|
||||
RELEASE_CONF="-Oz --closure 1 -DSK_RELEASE"
|
||||
# It is very important for the -DSK_RELEASE/-DSK_DEBUG to match on the libskia.a, otherwise
|
||||
# things like SKDEBUGCODE are sometimes compiled in and sometimes not, which can cause headaches
|
||||
# like sizeof() mismatching between .cpp files and .h files.
|
||||
@ -60,13 +60,13 @@ if [[ $@ == *test* ]]; then
|
||||
elif [[ $@ == *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 -sSAFE_HEAP=1 -sASSERTIONS=1 -g3 -DPATHKIT_TESTING -DSK_DEBUG"
|
||||
fi
|
||||
|
||||
WASM_CONF="-s WASM=1"
|
||||
WASM_CONF="-sWASM=1"
|
||||
if [[ $@ == *asm.js* ]]; then
|
||||
echo "Building with asm.js instead of WASM"
|
||||
WASM_CONF="-s WASM=0 -s ALLOW_MEMORY_GROWTH=1"
|
||||
WASM_CONF="-sWASM=0 -sALLOW_MEMORY_GROWTH=1"
|
||||
fi
|
||||
|
||||
OUTPUT="-o $BUILD_DIR/pathkit.js"
|
||||
@ -93,8 +93,8 @@ echo "Compiling bitcode"
|
||||
--args="cc=\"${EMCC}\" \
|
||||
cxx=\"${EMCXX}\" \
|
||||
ar=\"${EMAR}\" \
|
||||
extra_cflags=[\"-s\", \"WARN_UNALIGNED=1\",
|
||||
\"-s\", \"MAIN_MODULE=1\",
|
||||
extra_cflags=[
|
||||
\"-sMAIN_MODULE=1\",
|
||||
${EXTRA_CFLAGS}
|
||||
] \
|
||||
is_debug=false \
|
||||
@ -115,12 +115,13 @@ ${EMCXX} $RELEASE_CONF -std=c++17 \
|
||||
--pre-js $BASE_DIR/chaining.js \
|
||||
-fno-rtti -fno-exceptions -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \
|
||||
$WASM_CONF \
|
||||
-s ERROR_ON_UNDEFINED_SYMBOLS=1 \
|
||||
-s EXPORT_NAME="PathKitInit" \
|
||||
-s MODULARIZE=1 \
|
||||
-s NO_EXIT_RUNTIME=1 \
|
||||
-s NO_FILESYSTEM=1 \
|
||||
-s STRICT=1 \
|
||||
-sERROR_ON_UNDEFINED_SYMBOLS=1 \
|
||||
-sEXPORT_NAME="PathKitInit" \
|
||||
-sMODULARIZE=1 \
|
||||
-sNO_EXIT_RUNTIME=1 \
|
||||
-sNO_FILESYSTEM=1 \
|
||||
-sDYNAMIC_EXECUTION=0 \
|
||||
-sSTRICT=1 \
|
||||
$OUTPUT \
|
||||
$BASE_DIR/pathkit_wasm_bindings.cpp \
|
||||
${BUILD_DIR}/libpathkit.a
|
||||
|
Loading…
Reference in New Issue
Block a user