Build wasm viewer

40 views
Skip to first unread message

Данил Буланов

unread,
Feb 18, 2024, 9:33:26 AMFeb 18
to skia-discuss
I am trying to build a wasm Viewer version, and I have a problem, 

wasm-ld: error: obj/modules/canvaskit/canvaskit.viewer_bindings.o: undefined symbol: SvgSlide::SvgSlide(SkString const&, SkString const&)

That is the error which I get when trying to build it. I can clearly see in canvaskit's BUILD.gn file this file "../../tools/viewer/SvgSlide.cpp", appended to sources array in component("viewer_wasm") {, so I have no idea why it cant find the SvgSlide constructor

Данил Буланов

unread,
Feb 19, 2024, 2:54:03 AMFeb 19
to skia-discuss
I have finally managed to do it myself, turns out that wasm version of viewer was updated some time ago, and some stuff is outdated, just in case I will leave here some tips for newbies like me

The main obvious thing that I was missing is that I have to pass "viewer" flag into compile.sh, but not trying to change sources of BUILD.gn.
And since I run viewer in not oficial build mode, I have to set testonly flags in a couple of places (errors were straightforward, and I found those places easily)

And some updates for new stuff here:

I have updatesd BUILD.gn file in cavaskit, mor specificly  component("viewer_wasm") section, I have added this lines 
      "../../modules/svg/src/SkSVGFeBlend.cpp",
      "../../modules/svg/src/SkSVGFeLighting.cpp",
      "../../modules/svg/src/SkSVGFeDisplacementMap.cpp",
      "../../modules/svg/src/SkSVGFeLightSource.cpp",
      "../../modules/svg/src/SkSVGFeFlood.cpp",
      "../../modules/svg/src/SkSVGFeGaussianBlur.cpp",
      "../../modules/svg/src/SkSVGFeImage.cpp",
      "../../modules/svg/src/SkSVGMask.cpp",
      "../../modules/svg/src/SkSVGImage.cpp",
      "../../modules/svg/src/SkSVGFeOffset.cpp",
      "../../tools/fonts/FontToolUtils.cpp",
      "../../modules/svg/src/SkSVGFeMorphology.cpp",
to souces, which makes sense since it is what linker tells me by its errors.

And also viewer bindings are a little bit outdated, since SvgSlide has changed, and SampleSlide is gone (I think)


воскресенье, 18 февраля 2024 г. в 17:33:26 UTC+3, Данил Буланов:
Reply all
Reply to author
Forward
0 new messages