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?

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
david
  • 321
  • 3
  • 12
  • anyone please help.. – david May 08 '18 at 17:21
  • 1
    this may help: https://github.com/mono/SkiaSharp/wiki/Building-on-Linux and then specifically for Windows: https://github.com/mono/SkiaSharp/blob/605946352e543ee39345bb4969db28ddf2ae4977/cake/BuildExternals.cake#L95-L101 – Matthew May 09 '18 at 01:06
  • 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) – Matthew May 09 '18 at 01:07
  • @Matthew thanks, i could compile skia using your hint. – david May 09 '18 at 05:21

2 Answers2

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

Zoe
  • 27,060
  • 21
  • 118
  • 148
Dmitriy Adzhiev
  • 111
  • 1
  • 3
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'
david
  • 321
  • 3
  • 12