Missing header files when trying to build Skia

1,054 views
Skip to first unread message

Fudge

unread,
Oct 8, 2019, 10:42:23 AM10/8/19
to skia-discuss

Mike Klein

unread,
Oct 8, 2019, 10:47:44 AM10/8/19
to skia-discuss
If you don't have libpng (png.h) or zlib (zlib.h) you'll want to set skia_use_libpng = false and skia_use_zlib = false in out/Static/args.gn by running `gn args out/Static`.  You should probably also keep in mind you're doing a developer, debug build.

Most users of Skia should set is_official_build=true, and most developers should leave it to its false default.

This mode configures Skia in a way that’s suitable to ship: an optimized build with no debug symbols, dynamically linked against its third-party dependencies using the ordinary library search path.

In contrast, the developer-oriented default is an unoptimized build with full debug symbols and all third-party dependencies built from source and embedded into libskia. This is how we do all our manual and automated testing.

Skia offers several features that make use of third-party libraries, like libpng, libwebp, or libjpeg-turbo to decode images, or ICU and sftnly to subset fonts. All these third-party dependencies are optional and can be controlled by a GN argument that looks something like skia_use_foo for appropriate foo.

If skia_use_foo is enabled, enabling skia_use_system_foo will build and link Skia against the headers and libaries found on the system paths. is_official_build=true enables all skia_use_system_foo by default. You can use extra_cflags and extra_ldflags to add include or library paths if needed.



On Tue, Oct 8, 2019 at 9:42 AM Fudge <natandes...@gmail.com> wrote:
--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/fd8caf49-141e-4560-8df1-d3df2f0d7321%40googlegroups.com.

Fudge

unread,
Oct 8, 2019, 10:57:01 AM10/8/19
to skia-discuss
Oh! by "Most users of Skia should set is_official_build=true," I had assumed I was a user and should set the property to true. 
It seems to be building properly now. Thank you so much!

בתאריך יום שלישי, 8 באוקטובר 2019 בשעה 17:42:23 UTC+3, מאת Fudge:

Mike Klein

unread,
Oct 8, 2019, 10:58:03 AM10/8/19
to skia-discuss
You are, and you probably should?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

Fudge

unread,
Oct 8, 2019, 11:00:59 AM10/8/19
to skia-discuss
But doesn't  running `gn args out/Static` set it to false?
בתאריך יום שלישי, 8 באוקטובר 2019 בשעה 17:58:03 UTC+3, מאת Mike Klein:
You are, and you probably should?

On Tue, Oct 8, 2019 at 9:57 AM Fudge <natandes...@gmail.com> wrote:
Oh! by "Most users of Skia should set is_official_build=true," I had assumed I was a user and should set the property to true. 
It seems to be building properly now. Thank you so much!

בתאריך יום שלישי, 8 באוקטובר 2019 בשעה 17:42:23 UTC+3, מאת Fudge:

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-d...@googlegroups.com.

Mike Klein

unread,
Oct 8, 2019, 11:16:20 AM10/8/19
to skia-discuss
is_official_build is false by default.  You can see all your settings by running `gn args <dir> --list` to double check you have it set the way you want.

When is_official_build set to false, is_debug defaults to true, so you'll get massive binaries filled with debug symbols, little to no compiler optimization.  And all the various skia_use_some_library flags default to settings we like for testing, with most of skia_use_system_some_library set to false for our own convenience of being able to build these from source at a particular consistent version we like for testing.

When is_official_build is set to true, is_debug defaults to false, so you'll get smaller faster binaries.  And we still set all the skia_use_some_library flags based mostly on what makes sense for your target platform, but the skia_use_system_some_library flags will all start as true to build against your system versions of those libraries instead of building from source.  You can set skia_use_system_some_library = false to go back to building it from source, or skia_use_some_library = false to skip the whole feature.

To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/52d3d058-9de5-45d7-aaa7-160ba51a6801%40googlegroups.com.

Fudge

unread,
Oct 8, 2019, 1:12:32 PM10/8/19
to skia-discuss
Oh, I understand now (I think). Thank you!

בתאריך יום שלישי, 8 באוקטובר 2019 בשעה 18:16:20 UTC+3, מאת Mike Klein:

Fudge

unread,
Oct 8, 2019, 1:32:14 PM10/8/19
to skia-discuss
I seem to be missing a lot of libraries (ilibpng, zlib ,libjpeg ,harfbuzz, libwebp,expat), hopefully that won't cause problems down the line. 

בתאריך יום שלישי, 8 באוקטובר 2019 בשעה 20:12:32 UTC+3, מאת Fudge:

Mike Klein

unread,
Oct 8, 2019, 1:33:50 PM10/8/19
to skia-discuss
Yeah, it's fairly uncommon to have any of that on Windows.

To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/ced4aab7-fce6-42fa-a628-5a7543f19de3%40googlegroups.com.

Sal

unread,
Aug 7, 2020, 5:24:30 PM8/7/20
to skia-discuss
So we can do a dev build with is_official_build=false. But what do we do when we need to distribute out application for Windows users. How do we build with is_official_build=true for generating dll for distribution to users if these libraries are not available on Windows?

Mike Klein

unread,
Aug 7, 2020, 5:29:44 PM8/7/20
to skia-discuss
There are settings like 'skia_use_libpng=false' that you can use to turn off Skia's dependency on missing libraries, or you can build and ship those libraries along with Skia of course.

To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/0161d4d6-126e-472a-a7b3-8e0537db3a59o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages