OLD | NEW |
1 GN | 1 GN |
2 ===== | 2 ===== |
3 | 3 |
4 [GN](https://chromium.googlesource.com/chromium/src/tools/gn/) | 4 [GN](https://chromium.googlesource.com/chromium/src/tools/gn/) |
5 is a new meta-build system originally designed to replace GYP in Chromium. | 5 is a new meta-build system originally designed to replace GYP in Chromium. |
6 | 6 |
7 You can build Skia using GN in a limited number of configurations. We expect | 7 You can build Skia using GN in a limited number of configurations. We expect |
8 that as that limited number rises, GN will become the preferred, and then only, | 8 that as that limited number rises, GN will become the preferred, and then only, |
9 way to build Skia. | 9 way to build Skia. |
10 | 10 |
11 Supported Features | 11 Supported Features |
12 ---------- | 12 ---------- |
13 | 13 |
14 * Linux, Mac, Android | 14 * Linux, Mac, Android |
15 * Software and GL rendering | 15 * Software and GL rendering |
16 * libskia.a, libskia.so | 16 * libskia.a, libskia.so |
17 * DM, nanobench | 17 * DM, nanobench |
18 | 18 |
19 Quickstart | 19 Quickstart |
20 ---------- | 20 ---------- |
21 | 21 |
22 Please check out Skia using the instructions in one of the other quick start | 22 Please check out Skia using the instructions in one of the other quick start |
23 guides. We diverge where they'd first run some command with "gyp" in it. | 23 guides. We diverge where they'd first run some command with "gyp" in it. |
24 | 24 |
25 <!--?prettify lang=sh?--> | 25 <!--?prettify lang=sh?--> |
26 | 26 |
27 # After gclient sync, run fetch-gn to make sure you have GN. | 27 # After gclient sync, run fetch-gn to make sure you have GN. |
28 gclient sync && bin/fetch-gn | 28 gclient sync && bin/fetch-gn |
29 | 29 |
30 # Run GN to generate your build files. Some examples. | 30 # Run GN to generate your build files. |
| 31 gn gen out/Static --args='is_official_build=true' |
| 32 gn gen out/Shared --args='is_official_build=true is_component_build=true' |
| 33 |
| 34 # GN allows fine-grained settings for developers and special situations. |
31 gn gen out/Debug | 35 gn gen out/Debug |
32 gn gen out/Release --args='is_debug=false' | 36 gn gen out/Release --args='is_debug=false' |
33 gn gen out/Clang --args='cc="clang" cxx="clang++"' | 37 gn gen out/Clang --args='cc="clang" cxx="clang++"' |
34 gn gen out/Shared --args='is_component_build=true' | |
35 gn gen out/Cached --args='compiler_prefix="ccache"' | 38 gn gen out/Cached --args='compiler_prefix="ccache"' |
36 gn gen out/Stripped --args='extra_cflags="-g0"' | |
37 gn gen out/RTTI --args='extra_cflags_cc="-frtti"' | 39 gn gen out/RTTI --args='extra_cflags_cc="-frtti"' |
38 | 40 |
| 41 # To see all the current GN arguments, run |
| 42 gn args out/Debug --list |
| 43 |
39 # Build | 44 # Build |
| 45 ninja -C out/Static |
| 46 ninja -C out/Shared |
40 ninja -C out/Debug | 47 ninja -C out/Debug |
41 ninja -C out/Release | 48 ninja -C out/Release |
42 ninja -C out/Clang | 49 ninja -C out/Clang |
43 ninja -C out/Shared | |
44 ninja -C out/Cached | 50 ninja -C out/Cached |
45 ninja -C out/Stripped | |
46 ninja -C out/RTTI | 51 ninja -C out/RTTI |
47 | 52 |
48 From here everything is pretty much business as usual. | 53 From here everything is pretty much business as usual. |
49 | 54 |
50 Android | 55 Android |
51 ------- | 56 ------- |
52 | 57 |
53 To build Skia for Android you need an [Android | 58 To build Skia for Android you need an [Android |
54 NDK](https://developer.android.com/ndk/index.html). | 59 NDK](https://developer.android.com/ndk/index.html). |
55 | 60 |
(...skipping 11 matching lines...) Expand all Loading... |
67 <!--?prettify lang=sh?--> | 72 <!--?prettify lang=sh?--> |
68 | 73 |
69 gn gen out/arm --args='ndk="/tmp/ndk" target_cpu="arm"' | 74 gn gen out/arm --args='ndk="/tmp/ndk" target_cpu="arm"' |
70 gn gen out/arm64 --args='ndk="/tmp/ndk" target_cpu="arm64"' | 75 gn gen out/arm64 --args='ndk="/tmp/ndk" target_cpu="arm64"' |
71 gn gen out/mips64el --args='ndk="/tmp/ndk" target_cpu="mips64el"' | 76 gn gen out/mips64el --args='ndk="/tmp/ndk" target_cpu="mips64el"' |
72 gn gen out/mipsel --args='ndk="/tmp/ndk" target_cpu="mipsel"' | 77 gn gen out/mipsel --args='ndk="/tmp/ndk" target_cpu="mipsel"' |
73 gn gen out/x64 --args='ndk="/tmp/ndk" target_cpu="x64"' | 78 gn gen out/x64 --args='ndk="/tmp/ndk" target_cpu="x64"' |
74 gn gen out/x86 --args='ndk="/tmp/ndk" target_cpu="x86"' | 79 gn gen out/x86 --args='ndk="/tmp/ndk" target_cpu="x86"' |
75 | 80 |
76 Other arguments like `is_debug` and `is_component_build` continue to work. | 81 Other arguments like `is_debug` and `is_component_build` continue to work. |
| 82 Tweaking `ndk_api` gives you access to newer Android features like Vulkan. |
77 | 83 |
78 To test on a locally connected Android device, you can use our `droid` convenien
ce script: | 84 To test on a locally connected Android device, you can use our `droid` convenien
ce script: |
79 | 85 |
80 <!--?prettify lang=sh?--> | 86 <!--?prettify lang=sh?--> |
81 | 87 |
82 ninja -C out/arm64 | 88 ninja -C out/arm64 |
83 bin/droid out/arm64/dm --src gm --config gpu | 89 bin/droid out/arm64/dm --src gm --config gpu |
OLD | NEW |