How to compile skia on Windows
Asked Answered
N

2

7

I tried compiling skia on Windows as suggested in https://skia.org/user/build

  1. bin/gn gen out/Static --args='is_official_build=true'

  2. ninja -C out/Static

Build fails to find libjpeg.h, libpng.h

Then I added following line in gn args

extra_cflags = ["-I ../../third_party/externals/libpng/", "-I ../../third_party/externals/libjpeg-turbo/"]

It still fails to find both the headers.

But the point is that I should not pass include path because it should be handled internally if JPEG/PNG is core part of skia.

How do I build it on Windows?

Northeast answered 8/5, 2018 at 7:54 Comment(4)
anyone please help..Northeast
this may help: github.com/mono/SkiaSharp/wiki/Building-on-Linux and then specifically for Windows: github.com/mono/SkiaSharp/blob/…Montfort
Probably the most important thing to take out is the skia_use_system_libjpeg_turbo=false and others like it. Windows does not have a system libjpeg library, so you MUST use the internal one (or manage it elsewhere)Montfort
@Montfort thanks, i could compile skia using your hint.Northeast
H
11

I did it like here:

bin/gn gen out/Static --args='is_debug=false is_official_build=true skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_icu=false skia_use_system_harfbuzz=false'

Under windows 10 x64

Hexa answered 23/8, 2019 at 13:38 Comment(0)
N
3

I could compile skia on windows using following args

gn gen out/Static --args='is_debug=false is_official_build=true skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false'
Northeast answered 9/5, 2018 at 5:21 Comment(1)
What are you building for? For pure skia or are you going to use SkiaSharp?Montfort

© 2022 - 2025 — McMap. All rights reserved.