Skip to content

Commit 237825e

Browse files
committed
use stub PNG encoder for Windows DLL builds
Windows builds a shared library (DLL) which requires all symbols to be resolved at link time. The serialization code references SkPngEncoder::Encode, but we don't actually need PNG encoding for PathOps. Use skia_use_no_png_encode=true to provide a stub implementation that doesn't require libpng or zlib dependencies. Fixes the linker error: error LNK2019: unresolved external symbol SkPngEncoder::Encode
1 parent 23cfcde commit 237825e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

build_skia.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545

4646
if sys.platform == "win32":
4747
# On Windows, we build a shared library (DLL) which requires all symbols to be
48-
# resolved at link time. PNG encoder is referenced by serialization code, so we
49-
# must enable PNG encoding (and zlib which PNG depends on) for Windows DLL builds.
48+
# resolved at link time. PNG encoder is referenced by serialization code, but we
49+
# don't actually need PNG encoding for PathOps. Use the stub implementation instead.
5050
SKIA_BUILD_ARGS.extend([
51-
"skia_use_libpng_encode=true",
52-
"skia_use_libpng_decode=true",
53-
"skia_use_zlib=true",
51+
"skia_use_no_png_encode=true",
52+
"skia_use_libpng_decode=false",
53+
"skia_use_zlib=false",
5454
])
5555
else:
5656
SKIA_BUILD_ARGS.extend([

0 commit comments

Comments
 (0)