OLD | NEW |
1 Tips & FAQ | 1 Tips & FAQ |
2 ========== | 2 ========== |
3 | 3 |
4 <span id="gypdefines"></span> | 4 <span id="gypdefines"></span> |
5 | 5 |
6 Gyp Options | 6 Gyp Options |
7 ----------- | 7 ----------- |
8 | 8 |
9 When running `sync-and-gyp`, the `GYP_DEFINES` environment variable can | 9 When running `sync-and-gyp`, the `GYP_DEFINES` environment variable can |
10 be used to change Skia’s compile-time settings, using a | 10 be used to change Skia’s compile-time settings, using a |
11 space-separated list of key=value pairs. For example, to disable both | 11 space-separated list of key=value pairs. For example, to disable both |
12 the Skia GPU backend and PDF backends, run it as follows: | 12 the Skia GPU backend and PDF backends, run it as follows: |
13 | 13 |
14 <!--?prettify lang=sh?--> | 14 <!--?prettify lang=sh?--> |
15 | 15 |
16 GYP_DEFINES='skia_gpu=0 skia_pdf=0' python bin/sync-and-gyp | 16 GYP_DEFINES='skia_gpu=0 skia_pdf=0' python bin/sync-and-gyp |
17 ninja -C out/Debug | 17 ninja -C out/Debug |
18 | 18 |
19 Note: Setting enviroment variables in the Windows CMD.EXE shell [uses a | 19 Note: Setting enviroment variables in the Windows CMD.EXE shell [uses a |
20 different syntax](/user/quick/windows#env). | 20 different syntax](/user/quick/windows#env). |
21 | 21 |
22 You can also set environment variables such as `CC`, `CXX`, | 22 You can also set environment variables such as `CC`, `CXX`, |
23 `CFLAGS`, or `CPPFLAGS` to control how Skia is compiled. For | 23 `CFLAGS`, `CXXFLAGS`, or `CPPFLAGS` to control how Skia is compiled. |
24 example: | 24 To build with clang, for example: |
25 | 25 |
26 <!--?prettify lang=sh?--> | 26 <!--?prettify lang=sh?--> |
27 | 27 |
28 CC='clang' CXX='clang++' python bin/sync-and-gyp | 28 CC='clang' CXX='clang++' python bin/sync-and-gyp |
29 ninja -C out/Debug | 29 ninja -C out/Debug |
30 | 30 |
| 31 To build with clang and enable a compiler warning for unused parameters in C++ |
| 32 (but not C or assembly) code: |
| 33 |
| 34 <!--?prettify lang=sh?--> |
| 35 |
| 36 CXXFLAGS='-Wunused-parameter' |
| 37 CC='clang' CXX='clang++' python bin/sync-and-gyp |
| 38 ninja -C out/Debug |
| 39 |
| 40 |
31 The `GYP_GENERATORS` environment variable can be used to set the | 41 The `GYP_GENERATORS` environment variable can be used to set the |
32 build systems that you want to use (as a comma-separated list). | 42 build systems that you want to use (as a comma-separated list). |
33 The default is `'ninja,msvs-ninja'` on Windows, `'ninja,xcode'` on | 43 The default is `'ninja,msvs-ninja'` on Windows, `'ninja,xcode'` on |
34 Mac OS X, and just `'ninja'` on Linux. For example, to generate | 44 Mac OS X, and just `'ninja'` on Linux. For example, to generate |
35 only Ninja files on Mac: | 45 only Ninja files on Mac: |
36 | 46 |
37 <!--?prettify lang=sh?--> | 47 <!--?prettify lang=sh?--> |
38 | 48 |
39 GYP_GENERATORS='ninja' python bin/sync-and-gyp | 49 GYP_GENERATORS='ninja' python bin/sync-and-gyp |
40 ninja -C out/Debug | 50 ninja -C out/Debug |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 ------------------------------- | 135 ------------------------------- |
126 | 136 |
127 Skia has a built-in font cache, but it does not know how to actual render font | 137 Skia has a built-in font cache, but it does not know how to actual render font |
128 files like TrueType? into its cache. For that it relies on the platform to | 138 files like TrueType? into its cache. For that it relies on the platform to |
129 supply an instance of SkScalerContext?. This is Skia's abstract interface for | 139 supply an instance of SkScalerContext?. This is Skia's abstract interface for |
130 communicating with a font scaler engine. In src/ports you can see support | 140 communicating with a font scaler engine. In src/ports you can see support |
131 files for FreeType?, Mac OS X, and Windows GDI font engines. Other font | 141 files for FreeType?, Mac OS X, and Windows GDI font engines. Other font |
132 engines can easily be supported in a like manner. | 142 engines can easily be supported in a like manner. |
133 | 143 |
134 | 144 |
OLD | NEW |