|
GettingStartedOnLinux
How to check out and build Skia on Linux
How to check out and build Skia on Linuxoriginally written by epoger@google.com on 27 May 2011 status: updated by epoger on 29 June 2011 PrerequisitesMake sure the following have been installed:
Check out the source codeTo anonymously check out a read-only copy of the Skia source code, run the following commands: SKIA_INSTALLDIR=/home/$USER/src/skia # or wherever you want to install it mkdir -p $SKIA_INSTALLDIR cd $SKIA_INSTALLDIR svn checkout http://skia.googlecode.com/svn/trunk cd trunk If you plan to make changes, see instructions for downloading a writable copy within http://code.google.com/p/skia/wiki/DownloadingSkiaCode . Generate makefilesWe use the open-source gyp tool to generate Unix makefiles (and analogous build scripts on other platforms) from our multiplatform "gyp" files. You can generate the Unix makefiles by running ./gyp_skia (or ./gyp_skia -Dskia_scalar-fixed) within the trunk/ directory. Or, you can just rely on it being run automatically by the makefile examples shown below. Build and run tests(Like all steps shown on this page, this will automatically run the gyp_skia script to generate the platform-specific build files, and then run the build. Also, it must be run from within the trunk/ directory.) make tests out/Debug/tests By default, the target is built in Debug mode (SK_DEBUG is defined, and debug symbols are included in the binary). If you would like to build the Release version instead: make tests BUILDTYPE=Release out/Release/tests Build and run SampleAppThis time we will add the "-j" flag to fire up multiple threads during the build. (This can be used with the other targets too.) make -j SampleApp out/Debug/SampleApp When this launches, you should see a window with various graphical examples. To move through the sample app, use the following keypresses:
Build and run gm ("golden master") testsThis will display the return value (0 = success) after running the tests... make -j gm out/Debug/gm -r gm/base-linux ; echo $? You can also adjust the type used to represent SkScalar. By default, we use a float. To change that, run it as follows: GYP_DEFINES="skia_scalar=fixed" make -j gm out/Debug/gm -r gm/base-linux-fixed ; echo $? Build and run bench (performance testbench)Since bench tests performance, it usually makes more sense to run it in Release mode... make -j bench BUILDTYPE=Release out/Release/bench -repeat 2 Build toolsmake -j tools out/Debug/skdiff Clean up all generated filesmake clean |