First, install XCode.
# Install depot tools. git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' export PATH="${PWD}/depot_tools:${PATH}" # Get Skia. git clone 'https://skia.googlesource.com/skia' cd skia # Build. bin/sync-and-gyp ninja -C out/Debug # Run DM (the Skia test app) and SampleApp. out/Debug/dm out/Debug/SampleApp
Make sure the following have been installed:
Follow the instructions here for downloading the Skia source.
We use the open-source gyp tool to generate XCode projects (and analogous build scripts on other platforms) from our multiplatform "gyp" files.
Two Gyp generators are used on Mac OS:
ninja
- Run ninja yourself, without XCode project files,
xcode
- Generate a XCode project
To choose which ones to use, set the GYP_GENERATORS
environment variable to a comma-delimited list of generators before running sync-and-gyp. The default value for GYP_GENERATORS
is ninja,xcode
. For example to enable
Before building, make sure that gyp knows to create an XCode project or ninja build files. If you leave GYP_GENERATORS undefined it will assume the following default:
GYP_GENERATORS="ninja,xcode"
Or you can set it to ninja
or xcode
alone, if you like.
You can then generate the Xcode projects and ninja build files by running:
python bin/sync-and-gyp
ninja -C out/Debug dm out/Debug/dm
sync-and-gyp
as described above.$SKIA_INSTALLDIR/trunk/out/gyp