buildninjaskiagn

Can't build a Skia module (SkPlainTextEditor)


I'm trying to build Skia's modules/skplaintexteditor:

https://chromium.googlesource.com/skia/+/master/modules/skplaintexteditor/


I have followed the instructions in README.md:

tools/git-sync-deps
bin/gn gen out/default
ninja -C out/default editor

The first two commands are working, but the ninja build is failing with:

ninja: error: unknown target 'editor'

Skia itself is building fine (i.e. if I don't specify the editor target in the ninja command).


What is missing here? How do I build skplaintexteditor?


Solution

  • Brian Osman answered in this topic on Google Groups:

    Currently, all of our "test" tools (which includes experimental modules like the editor) fall under the skia_enable_tools umbrella. That requires gpu support (skia_enable_gpu = true), and static linking (is_component_build = false). The logic to enforce this is at the end of gn/skia.gni. Some of the experimental modules used by the editor use private Skia APIs, so those modules don't handle component builds correctly.

    So, adding the arguments:

    is_component_build = false
    skia_enable_gpu = true
    

    fixes the build.