d1285b131b
Changes are largely mechanical. Non-mechanical changes to support newer versions of emscripten are enumerated below, in format ${EMSCRIPTEN_VERSION}: ${RELEVANT_CHANGE}. - 1.39.9: TOTAL_MEMORY has been renamed INITIAL_MEMORY. - 1.39.12: passing of linker flags to wasm-ld has changed in a way that requires supplying `--no-entry` to avoid error message "wasm-ld: error: entry symbol not defined (pass --no-entry to suppress): main". - 1.39.16: The factory function created by using `MODULARIZE` build option now returns a Promise instead of the module instance. As such, the ready.js workaround is removed. Note this is a breaking API change for CanvasKit, which now uses just `then()` and not `ready().then()`. - 1.38.33: `emsdk install` hasn't required the `-64bit` suffix on version names since `1.38.33`, so we remove them. E.g. `emsdk install sdk-1.39.6-64bit` simply becomes `emsdk install sdk-1.39.16`. cf. https://github.com/emscripten-core/emscripten/blob/master/ChangeLog.md Bug: NONE Change-Id: Iabec4bd5ad7db2e0715ad42c2e4cf7d67b192b4c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291182 Reviewed-by: Kevin Lubick <kjlubick@google.com>
96 lines
3.3 KiB
Makefile
96 lines
3.3 KiB
Makefile
clean:
|
|
rm -rf ../../out/canvaskit_wasm
|
|
rm -rf ./canvaskit/bin
|
|
$(MAKE) release
|
|
|
|
release:
|
|
# Does an incremental build where possible.
|
|
./compile.sh
|
|
mkdir -p ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./canvaskit/bin
|
|
|
|
release_cpu:
|
|
# Does an incremental build where possible.
|
|
./compile.sh cpu_only
|
|
mkdir -p ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./canvaskit/bin
|
|
|
|
release_viewer:
|
|
# Does an incremental build where possible.
|
|
./compile.sh viewer
|
|
mkdir -p ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./canvaskit/bin
|
|
|
|
debug:
|
|
# Does an incremental build where possible.
|
|
./compile.sh debug
|
|
mkdir -p ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.js ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm.map ./canvaskit/bin
|
|
|
|
debug_cpu:
|
|
# Does an incremental build where possible.
|
|
./compile.sh debug cpu_only
|
|
mkdir -p ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.js ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm.map ./canvaskit/bin
|
|
|
|
debug_viewer:
|
|
# Does an incremental build where possible.
|
|
./compile.sh debug viewer
|
|
mkdir -p ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.js ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm.map ./canvaskit/bin
|
|
|
|
profile:
|
|
./compile.sh profiling
|
|
mkdir -p ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_profile/canvaskit.js ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm_profile/canvaskit.wasm ./canvaskit/bin
|
|
|
|
npm:
|
|
rm -rf ./canvaskit/bin
|
|
mkdir -p ./canvaskit/bin
|
|
# These features are turned off to keep code size smaller for the
|
|
# general use case.
|
|
./compile.sh release no_skottie no_particles no_pathops no_rt_shader no_skp no_alias_font
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./canvaskit/bin
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./canvaskit/bin
|
|
|
|
mkdir -p ./canvaskit/bin/core
|
|
./compile.sh release no_skottie no_particles no_pathops no_rt_shader no_font no_skp
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./canvaskit/bin/core
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./canvaskit/bin/core
|
|
|
|
local-example:
|
|
rm -rf node_modules/canvaskit
|
|
mkdir -p node_modules
|
|
ln -s ../canvaskit node_modules/canvaskit
|
|
echo "Go check out http://localhost:8000/canvaskit/example.html"
|
|
python serve.py
|
|
|
|
test-continuous:
|
|
echo "Assuming npm install has been run by user"
|
|
echo "Also assuming make debug or release has also been run by a user (if needed)"
|
|
npx karma start ./karma.conf.js --no-single-run --watch-poll
|
|
|
|
.PHONY: perf
|
|
perf:
|
|
npx karma start ./karma.bench.conf.js --single-run
|
|
|
|
node-example:
|
|
node ./canvaskit/node.example.js --expose-wasm
|
|
|
|
docker-compile:
|
|
mkdir -p ${SKIA_ROOT}/out/canvaskit_wasm_docker
|
|
docker run --rm --volume ${SKIA_ROOT}:/SRC \
|
|
--volume ${SKIA_ROOT}/out/canvaskit_wasm_docker:/OUT \
|
|
gcr.io/skia-public/canvaskit-emsdk:1.39.16_v1 \
|
|
/SRC/infra/canvaskit/build_canvaskit.sh
|