microsoft / microsoft/vcpkg

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

Open
#53,359 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
CMake
Stars
27.5k
Forks
7.7k
Avg merge
2d 19h
Merged PRs (30d)
321

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 __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!

Contributor guide

Open the contributing guide

Research direction

Inspect the Skia portfile and the installed unofficial-skia-targets.cmake file to trace how optional modules and CMake targets are defined. Reproduce the unresolved SkSVGDOM symbols with the listed vcpkg features, then determine whether the completed change should provide an SVG feature and target or document the exclusion clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.