OS X and iOS support so called "fat-binaries". Indeed, both systems use the Mach-O file format, which supports packing several objects in a single file. The idea being to compile the same source file targetting multiple architectures, and to glue the generated objects into a single .o file. This way we keep the 1:1 mapping between .cpp files and .o files, while still handling multiple architectures.
Being able to build Skia as a fat binary is very convenient, and I think would help adoption.
Indeed, when using Skia in an app, the 3rd-party developer will want to:
- Use the app on the Simulator
- Use the app on an iPhone 4 (armv7)
- Use the app on a newer 64-bit iPhone
If we pack all those version in a single .a file, it is extremely convenient because the developer can transparently switch from one target to the other without changing anythin in his build process. His environment (likely Xcode) will build FAT binaries anyway, and the right version will be picked up at runtime by the device running the app.
Currently, Skia builds as different .a files. This is annoying when using Skia: one has to either manually re-create fat binaries, or to tweak Xcode in a fashion that's not very fun :-)