Building for iOS?

247 views
Skip to first unread message

edA-qa mort-ora-y

unread,
Jan 12, 2017, 4:20:38 AM1/12/17
to skia-discuss
Are there any current instructions for how to build Skia for iOS. I see the old GYP files still exist, but I guess they aren't actual?

I'm trying to produce a cross-compiled static library from OSX, I don't need XCode project files to be produced.

I've tried `gn gen out/StaticDebugiOS --args='is_debug=true skia_use_libpng=false target_cpu="arm" target_os="ios"'` but I'd also somehow need the `arm_neon=0` from the old GYP setup I guess?

Jean-Claude Monnin

unread,
Jan 12, 2017, 4:42:18 AM1/12/17
to skia-d...@googlegroups.com
I was able to build successfully the lib for iOS arm64 using:

gn gen out/iOS-arm64 --args='is_official_build=true target_os="ios" target_cpu="arm64" skia_enable_gpu=false skia_enable_tools=false skia_use_dng_sdk=false skia_use_expat=false skia_use_icu=false skia_use_libjpeg_turbo=false skia_use_libpng=false skia_use_libwebp=false skia_use_piex=false skia_use_sfntly=false skia_use_zlib=false  extra_cflags_cc = ["-miphoneos-version-min=8.0"]'

I need a very minimalistic skia without GPU support. It probably would also work with less options.

I couldn't get it to compile for both arm and simulator. Fixing it is beyond my capabilities (I'm not familiar with gn).

It would be very nice if iOS gn build would work for arm and simulator.

--
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 post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

edA-qa mort-ora-y

unread,
Jan 12, 2017, 5:48:33 AM1/12/17
to skia-discuss
that seems to build for arm64, but I need armv7 support as well. There appears to be an error on this target though:

../../src/gpu/gl/GrGLAssembleInterface.cpp:81:32: error: type 'GrGLInterface' requires 8 bytes of alignment and the default allocator only guarantees 4 bytes [-Werror,-Wover-aligned]
    GrGLInterface* interface = new GrGLInterface();

I don't know if I could simply disable -Wover-aligned (I'd try, but I'm not sure how to suppress that flag)

Mike Klein

unread,
Jan 12, 2017, 6:37:21 AM1/12/17
to skia-discuss
Hi!

We haven't really gotten GN in shape yet for iOS.  That's the one remaining platform that we still mostly use GYP for.

As you've noticed, we do have some basic build support for iOS in GN, but those builds are not yet tested.  So far we've only ever built for arm64.  One of the things that I'll be looking at is making fat armv7 / arm64 iOS builds, and maybe mix the simulator in there on dev builds.  I don't plan to support non-NEON builds on iOS, given that all iPhones back to the 3GS have NEON.

We've run into this Wover-aligned problem before with Clang (on 32-bit x86 Android) and we think it's just wrong.  You can see how we handle that with `git grep -- -Wno-over-aligned`.

Nikita Kunevich

unread,
Jan 20, 2017, 12:56:37 PM1/20/17
to skia-discuss
Mike, is it possible to build Skia for iOS with GYP and have library size at least less than 50 MB? When I'm building Skia it's about 200 MB in size. Maybe it's debugging info or something else. 
So if know how to do it can you please write the steps?

Mike Klein

unread,
Jan 20, 2017, 12:58:03 PM1/20/17
to skia-discuss
No, we're not going to update our GYP builds.  You're currently stuck without a solution for now until I get around to updating the build to use GN.

It does sound right that you're doing a debug build or a release build with debug symbols.  You may want to explore the options the strip binary offers you.
Reply all
Reply to author
Forward
0 new messages