Skip to content

[skia] Missing SVG support: no CMake target nor built-in symbols for SkSVGDOM #53359

Description

Description

The vcpkg skia package does not provide SVG support. When attempting to use Skia's SVG functionality (e.g., SkSVGDOM), linking fails with unresolved external symbols, even after linking only the core library unofficial::skia::skia. Additionally, the modular target unofficial::skia::modules::svg is not found, as reported in the CMake configuration.

I expect that either:

  • The core library includes SVG support (and the symbols are exported), or
  • There is a separate CMake target for the SVG module that can be linked.

Neither is currently the case.

Steps to reproduce

  1. Install Skia via vcpkg:

    vcpkg install skia
    

    (My vcpkg.json includes features: freetype, gl, harfbuzz, icu, jpeg, png, webp. No svg feature is available.)

  2. In CMake, find the package and link the core library:

    find_package(unofficial-skia CONFIG REQUIRED)
    target_link_libraries(main PRIVATE unofficial::skia::skia)
    
  3. Use SVG code in your project, e.g.:

    auto stream = SkMemoryStream::MakeCopy(code.data(), code.size());
    auto svgDom = SkSVGDOM::MakeFromStream(*stream);
    
  4. Build the project. Linking fails with errors like:

    error LNK2019: unresolved external symbol "public: static class sk_sp<class SkSVGDOM> __cdecl SkSVGDOM::MakeFromStream(class SkStream &)"
    error LNK2019: unresolved external symbol "public: void __cdecl SkSVGDOM::setContainerSize(struct SkSize const &)"
    error LNK2019: unresolved external symbol "public: void __cdecl SkSVGDOM::render(class SkCanvas *)const"
    

    If I attempt to link the (non-existent) modular target:

    target_link_libraries(main PRIVATE unofficial::skia::modules::svg)
    

    CMake errors with:

    Target "main" links to unofficial::skia::modules::svg but the target was not found.
    

Environment

  • OS: Windows 11 25H2 (10.0.26200)
  • Compiler: MSVC 19.40.36231 (from Visual Studio 18 2026)
  • vcpkg version: (latest, as of 2026-08-11)
  • Triplet: x64-windows
  • Skia package version: skia:x64-windows@148 (installed with features: core,webp,png,jpeg,icu,harfbuzz,gl,freetype,dng)
  • CMake version: 3.15+ (tested with 3.31)

Additional context

  • I did not build Skia manually; I rely solely on vcpkg's prebuilt binary.
  • The official Skia documentation indicates that SVG support is optional and can be enabled via the GN flag skia_enable_svg = true. The vcpkg portfile does not currently expose this option.
  • The CMake file unofficial-skia-targets.cmake (provided by the package) does not list any target for SVG, confirming it is not built.
  • I have also checked the installed lib/ directory for any library named skia_svg or similar – none exists.

Suggestion

Please consider adding an optional feature (e.g., skia[svg]) that enables SVG support, either by:

  • Building the SVG module as a separate library and exporting the corresponding CMake target (e.g., unofficial::skia::modules::svg), or
  • Including SVG symbols directly into the core library when the feature is enabled.

Alternatively, if SVG is intentionally excluded, please document this limitation clearly in the package description.

Thank you for maintaining this package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions