无法构建 Skia 模块 (SkPlainTextEditor)

Can't build a Skia module (SkPlainTextEditor)

我正在尝试构建 Skia 的 modules/skplaintexteditor:

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


我已按照 README.md 中的说明进行操作:

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

前两个命令有效,但 ninja 构建失败:

ninja: error: unknown target 'editor'

Skia 本身构建良好(即如果我没有在 ninja 命令中指定 editor 目标)。


这里缺少什么?如何构建 skplaintexteditor

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.

因此,添加参数:

is_component_build = false
skia_enable_gpu = true

修复构建。