|
GettingStartedOnWindows
How to check out and build Skia on Windows
How to check out and build Skia on Windowsoriginally written by epoger@google.com on 2 June 2011 status: updated as of 23 March 2012 PrerequisitesMake sure the following have been installed:
Check out the source codeTo anonymously check out a read-only copy of the Skia source code, open a Command Prompt and run the following commands: rem Modify the below line to install wherever you like set SKIA_INSTALLDIR=%HOMEPATH%\src\skia mkdir %SKIA_INSTALLDIR% cd %SKIA_INSTALLDIR% svn checkout http://skia.googlecode.com/svn/trunk If you plan to make changes, see instructions for downloading a writable copy within http://code.google.com/p/skia/wiki/DownloadingSkiaCode . Generate Visual Studio projectsWe use the open-source gyp tool to generate Visual Studio projects (and analogous build scripts on other platforms) from our multiplatform "gyp" files. You can generate the Visual Studio projects by running gyp_skia, as follows: cd %SKIA_INSTALLDIR%\trunk python gyp_skia rem Or, to generate buildfiles for SKIA_SCALAR_IS_FIXED: python gyp_skia -Dskia_scalar=fixed Or, you can just rely on it being run automatically by the "make" examples shown below. Note that you will see a bunch of Warnings like the following when you run gyp_skia. They are the result of a gyp bug, but they should not prevent you from building your code successfully. Warning: Missing input file C:\Users\epoger\src\skia\test\gyp\pdf.gyp Warning: Missing input file C:\Users\epoger\src\skia\test\gyp\experimental.gyp ... Build and run tests from the command line(Like all command-line builds 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 tests in the Visual Studio IDE
Build and run SampleApp in Visual Studio
Build and run gm ("golden master") tests from the command lineThis will display the return value (0 = success) after running the tests... make gm out\Debug\gm -r gm\base-win echo %ERRORLEVEL% You can also adjust the type used to represent SkScalar. By default, we use a float. To change that, run it as follows. (It should return an errorlevel of -1, because the base-win base images don't match the output when skia_scalar=fixed.) make gm GYP_DEFINES=skia_scalar=fixed out\Debug\gm -r gm\base-win-fixed echo %ERRORLEVEL% Build and run bench (performance testbench) from the command lineSince bench tests performance, it usually makes more sense to run it in Release mode... make bench BUILDTYPE=Release out\Release\bench -repeat 2 Build toolsmake tools out\Debug\skdiff Clean up all generated filesmake clean Building with Visual Studio 2008This isn't supported, but the following steps were observed to work on 11/21/2011:
args.extend(['-Gmsvs_version=2010']) |