OLD | NEW |
(Empty) | |
| 1 Desktop |
| 2 ======= |
| 3 |
| 4 Instructions to get started with Skia on desktop systems (Linux, Mac OS X, or Wi
ndows). |
| 5 |
| 6 1. [Download Skia](/user/download) |
| 7 |
| 8 <!--?prettify lang=sh?--> |
| 9 |
| 10 git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.
git' |
| 11 export PATH="${PWD}/depot_tools:${PATH}" |
| 12 git clone 'https://skia.googlesource.com/skia.git' |
| 13 cd skia |
| 14 |
| 15 (On Windows without git, swap steps 1 and 2) |
| 16 |
| 17 2. Install system-specific prerequisites. |
| 18 - [Linux](/user/quick/linux) |
| 19 - [Mac OS X](/user/quick/macos) |
| 20 - [Windows](/user/quick/windows) |
| 21 |
| 22 3. Sync dependencies and config. Build. Run tests. |
| 23 |
| 24 <!--?prettify lang=sh?--> |
| 25 |
| 26 python bin/sync-and-gyp |
| 27 ninja -C out/Debug |
| 28 out/Debug/dm |
| 29 |
| 30 Gyp Options |
| 31 ----------- |
| 32 |
| 33 When running `sync-and-gyp`, the `GYP_DEFINES` environment variable can |
| 34 be used to change Skia’s compile-time settings, using a |
| 35 space-separated list of key=value pairs. For example, to disable both |
| 36 the Skia GPU backend and PDF backends, run it as follows: |
| 37 |
| 38 <!--?prettify lang=sh?--> |
| 39 |
| 40 GYP_DEFINES='skia_gpu=0 skia_pdf=0' python bin/sync-and-gyp |
| 41 ninja -C out/Debug |
| 42 |
| 43 Note: Setting enviroment variables in the Windows CMD.EXE shell [uses a |
| 44 different syntax](./windows#env). |
| 45 |
| 46 You can also set environment variables such as `CC`, `CXX`, |
| 47 `CFLAGS`, or `CPPFLAGS` to control how Skia is compiled. For |
| 48 example: |
| 49 |
| 50 <!--?prettify lang=sh?--> |
| 51 |
| 52 CC='clang' CXX='clang++' python bin/sync-and-gyp |
| 53 ninja -C out/Debug |
| 54 |
| 55 The `GYP_GENERATORS` environment variable can be used to set the |
| 56 build systems that you want to use (as a comma-separated list). |
| 57 The default is `'ninja,msvs-ninja'` on Windows, `'ninja,xcode'` on |
| 58 Mac OS X, and just `'ninja'` on Linux. For example, to generate |
| 59 only Ninja files on Mac: |
| 60 |
| 61 <!--?prettify lang=sh?--> |
| 62 |
| 63 GYP_GENERATORS='ninja' python bin/sync-and-gyp |
| 64 ninja -C out/Debug |
| 65 |
| 66 Finally, the `SKIA_OUT` environment variable can be used to set |
| 67 the path for the build directory. The default is `out` inside the |
| 68 top-level Skia source directory. For example to test Skia with |
| 69 two different compilers: |
| 70 |
| 71 <!--?prettify lang=sh?--> |
| 72 |
| 73 CC='clang' CXX='clang++' SKIA_OUT=~/build/skia_clang python bin/sync-and-gyp |
| 74 CC='gcc' CXX='g++' SKIA_OUT=~/build/skia_gcc python bin/sync-and-gyp |
| 75 ninja -C ~/build/skia_clang/Debug |
| 76 ninja -C ~/build/skia_gcc/Debug |
| 77 |
| 78 Run unit and correctness tests |
| 79 ------------------------------ |
| 80 |
| 81 [DM](../../dev/testing/testing) ("diamond master") is the Skia test app. |
| 82 |
| 83 <!--?prettify lang=sh?--> |
| 84 |
| 85 ninja -C out/Debug dm |
| 86 out/Debug/dm |
| 87 |
| 88 Run Skia samples |
| 89 ---------------- |
| 90 |
| 91 [SampleApp](../sample/sampleapp) is the Skia sample program. |
| 92 |
| 93 <!--?prettify lang=sh?--> |
| 94 |
| 95 ninja -C out/Debug SampleApp |
| 96 out/Debug/SampleApp |
| 97 |
| 98 Build non-debug binaries |
| 99 ------------------------ |
| 100 |
| 101 The usual mode you want for testing is Debug mode (`SK_DEBUG` is |
| 102 defined, and debug symbols are included in the binary). If you |
| 103 would like to build the Release mode: |
| 104 |
| 105 <!--?prettify lang=sh?--> |
| 106 |
| 107 ninja -C out/Release |
| 108 |
| 109 Performance tests |
| 110 ----------------- |
| 111 |
| 112 Build and run nanobench (performance tests). In this case, we will |
| 113 build with the "Release" configuration, since we are running |
| 114 performance tests. |
| 115 |
| 116 <!--?prettify lang=sh?--> |
| 117 |
| 118 ninja -C out/Release nanobench |
| 119 out/Release/nanobench |
| 120 out/Release/nanobench --skps .../path/to/*.skp |
| 121 |
| 122 <!-- TODO(mtklein): document nanobench --> |
| 123 |
| 124 Keeping up to date |
| 125 ------------------ |
| 126 |
| 127 <!--?prettify lang=sh?--> |
| 128 |
| 129 git fetch origin |
| 130 git checkout origin/master |
| 131 |
| 132 Contribute to Skia |
| 133 ------------------ |
| 134 |
| 135 [How to use Git and Git-cl to contribute to Skia](/dev/contrib/submit). |
OLD | NEW |