c123b5a93d
This may look like a lot, but //modules/canvaskit/BUILD.bazel
is nearly identical to how it was with gazelle:
162dfca340/modules/canvaskit/BUILD.bazel
I removed the "wasm_gm_tests" targets from it, because they
had bitrotted slightly and fixing them is its own task.
CanvasKit depends on Skottie and Particles, which depend on
the SkParagraph, SkShaper, SkUnicode, and SkResources modules.
I've structured the BUILD.bazel files in the //modules directory
in a similar fashion as the "hierarchical filegroup"
introduced in https://skia-review.googlesource.com/c/skia/+/543977
Suggested Review Order
- //modules/skottie/...
- //modules/skparagraph/...
- all other modules.
- Note that modules/canvaskit/go/gold_test_env/BUILD.bazel is
generated from gazelle, because we like how gazelle handles
golang files and deps.
- All other files in any order.
Change-Id: I0aa9e6f81dba2c00f15cae7b19fe49a2027dcf1d
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544676
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
175 lines
6.1 KiB
Makefile
175 lines
6.1 KiB
Makefile
clean:
|
|
- rm -rf ../../out/canvaskit_wasm
|
|
- rm -rf ./npm_build/bin
|
|
- rm -rf ./build/
|
|
$(MAKE) release
|
|
|
|
release:
|
|
# Does an incremental build where possible.
|
|
./compile.sh
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./build/
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./build/
|
|
|
|
release_cpu:
|
|
# Does an incremental build where possible.
|
|
./compile.sh cpu_only
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./build/
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./build/
|
|
|
|
release_viewer:
|
|
# Does an incremental build where possible.
|
|
./compile.sh viewer
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./build/
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./build/
|
|
|
|
debug:
|
|
# Does an incremental build where possible.
|
|
./compile.sh debug_build
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.js ./build/
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./build/
|
|
|
|
debug_cpu:
|
|
# Does an incremental build where possible.
|
|
./compile.sh debug_build cpu_only
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.js ./build/
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./build/
|
|
|
|
debug_viewer:
|
|
# Does an incremental build where possible.
|
|
./compile.sh debug_build viewer
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.js ./build/
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./build/
|
|
|
|
profile:
|
|
./compile.sh profiling
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../out/canvaskit_wasm_profile/canvaskit.js ./build/
|
|
cp ../../out/canvaskit_wasm_profile/canvaskit.wasm ./build/
|
|
|
|
npm:
|
|
rm -rf ./npm_build/bin
|
|
mkdir -p ./npm_build/bin
|
|
cp ./CHANGELOG.md ./npm_build/
|
|
|
|
mkdir -p ./npm_build/bin/full
|
|
./compile.sh release
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./npm_build/bin/full
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./npm_build/bin/full
|
|
|
|
# These features are turned off to keep code size smaller for the
|
|
# general use case.
|
|
./compile.sh release no_skottie no_particles no_rt_shader no_sksl_trace no_alias_font \
|
|
no_effects_deserialization no_encode_jpeg no_encode_webp legacy_draw_vertices
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./npm_build/bin
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./npm_build/bin
|
|
|
|
mkdir -p ./npm_build/bin/profiling
|
|
./compile.sh profiling
|
|
cp ../../out/canvaskit_wasm_profile/canvaskit.js ./npm_build/bin/profiling
|
|
cp ../../out/canvaskit_wasm_profile/canvaskit.wasm ./npm_build/bin/profiling
|
|
|
|
gm_tests_debug:
|
|
./compile_gm.sh debug
|
|
mkdir -p ./out
|
|
cp ../../out/wasm_gm_tests_debug/wasm_gm_tests.js ./out
|
|
cp ../../out/wasm_gm_tests_debug/wasm_gm_tests.wasm ./out
|
|
|
|
gm_tests:
|
|
./compile_gm.sh
|
|
mkdir -p ./out
|
|
cp ../../out/wasm_gm_tests/wasm_gm_tests.js ./out
|
|
cp ../../out/wasm_gm_tests/wasm_gm_tests.wasm ./out
|
|
|
|
local-example:
|
|
echo "Go check out http://localhost:8000/npm_build/example.html"
|
|
python3 ../../tools/serve_wasm.py
|
|
|
|
test-continuous:
|
|
echo "Assuming npm ci 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
|
|
|
|
test-continuous-headless:
|
|
npx karma start ./karma.conf.js --no-single-run --watch-poll --headless
|
|
|
|
node-example:
|
|
node ./npm_build/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:2.0.0_v1 \
|
|
/SRC/infra/canvaskit/build_canvaskit.sh
|
|
|
|
typecheck:
|
|
echo "Make sure you've run cd npm_build && npm ci recently"
|
|
cd npm_build && npm run dtslint
|
|
|
|
bazel_canvaskit_debug:
|
|
bazelisk build :canvaskit_wasm --config=ck_debug
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../bazel-bin/modules/canvaskit/canvaskit_wasm/canvaskit.js build/canvaskit.js
|
|
cp ../../bazel-bin/modules/canvaskit/canvaskit_wasm/canvaskit.wasm build/canvaskit.wasm
|
|
|
|
bazel_canvaskit_release:
|
|
bazelisk build :canvaskit_wasm --config=ck_release
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../bazel-bin/modules/canvaskit/canvaskit_wasm/canvaskit.js build/canvaskit.js
|
|
cp ../../bazel-bin/modules/canvaskit/canvaskit_wasm/canvaskit.wasm build/canvaskit.wasm
|
|
ls -l build
|
|
|
|
bazel_test_canvaskit:
|
|
bazelisk test :canvaskit_js_tests --config=ck_release --test_output=streamed
|
|
echo "test output in //bazel-testlogs/modules/canvaskit/canvaskit_js_wasms/test.outputs/"
|
|
ls ../../bazel-testlogs/modules/canvaskit/canvaskit_js_wasms/test.outputs/
|
|
|
|
with_debugger:
|
|
# Does an incremental build where possible.
|
|
./compile.sh debug_build enable_debugger
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.js ./build/
|
|
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./build/
|
|
- mkdir ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/
|
|
cp ./build/canvaskit.js ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/
|
|
cp ./build/canvaskit.wasm ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/
|
|
cp ./npm_build/types/index.d.ts ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/canvaskit.d.ts
|
|
|
|
with_debugger_release:
|
|
./compile.sh enable_debugger
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./build/
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./build/
|
|
- mkdir ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/
|
|
cp ./build/canvaskit.js ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/
|
|
cp ./build/canvaskit.wasm ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/
|
|
cp ./npm_build/types/index.d.ts ${SKIA_INFRA_ROOT}/debugger-app/wasm_libs/local_build/canvaskit.d.ts
|
|
|
|
for_shaders:
|
|
./compile.sh
|
|
- rm -rf build/
|
|
mkdir build
|
|
cp ../../out/canvaskit_wasm/canvaskit.js ./build/
|
|
cp ../../out/canvaskit_wasm/canvaskit.wasm ./build/
|
|
- mkdir ${SKIA_INFRA_ROOT}/shaders/wasm_libs/local_build/
|
|
cp ./build/canvaskit.js ${SKIA_INFRA_ROOT}/shaders/wasm_libs/local_build/
|
|
cp ./build/canvaskit.wasm ${SKIA_INFRA_ROOT}/shaders/wasm_libs/local_build/
|
|
cp ./npm_build/types/index.d.ts ${SKIA_INFRA_ROOT}/shaders/wasm_libs/local_build/canvaskit.d.ts
|