aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/user
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-08-29 10:27:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-29 10:27:16 -0700
commitadbd480102ff0f1d7f85b09e3d87c713f2442dd2 (patch)
tree03fbe64f43c8cbdade1c314c1165dce0a94017f8 /site/user
parent7957872f39f988d19793276680ae663da2d563fe (diff)
Add docs for GN/Android
While I'm at it, add a few more examples of other types of builds you can do. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2289883002 NOTRY=true DOCS_PREVIEW= https://skia.org/user/quick/gn?cl=2289883002 Review-Url: https://codereview.chromium.org/2289883002
Diffstat (limited to 'site/user')
-rw-r--r--site/user/quick/gn.md44
1 files changed, 39 insertions, 5 deletions
diff --git a/site/user/quick/gn.md b/site/user/quick/gn.md
index 915a823526..ad7f1090a1 100644
--- a/site/user/quick/gn.md
+++ b/site/user/quick/gn.md
@@ -11,7 +11,7 @@ way to build Skia.
Supported Features
----------
- * Linux, Mac
+ * Linux, Mac, Android
* Software and GL rendering
* libskia.a, libskia.so
* DM, nanobench
@@ -29,14 +29,48 @@ guides. We diverge where they'd first run some command with "gyp" in it.
# Run GN to generate your build files. Some examples.
gn gen out/Debug
- gn gen out/Release --args=is_debug=false
- gn gen out/Clang --args='cc="clang" cxx="clang++"'
- gn gen out/Shared --args=is_component_build=true
+ gn gen out/Release --args='is_debug=false'
+ gn gen out/Clang --args='cc="clang" cxx="clang++"'
+ gn gen out/Shared --args='is_component_build=true'
+ gn gen out/Cached --args='compiler_prefix="ccache"'
+ gn gen out/Stripped --args='extra_cflags="-g0"'
+ gn gen out/RTTI --args='extra_cflags_cc="-frtti"'
# Build
- ninja -C out/Release
ninja -C out/Debug
+ ninja -C out/Release
ninja -C out/Clang
ninja -C out/Shared
+ ninja -C out/Cached
+ ninja -C out/Stripped
+ ninja -C out/RTTI
From here everything is pretty much business as usual.
+
+Android
+-------
+
+To build Skia for Android you need an [Android
+NDK](https://developer.android.com/ndk/index.html).
+
+If you do not have an NDK and have access to CIPD, you
+can use one of these commands to fetch the NDK our bots use:
+
+<!--?prettify lang=sh?-->
+
+ python infra/bots/assets/android_ndk_linux/download.py -t /tmp/ndk
+ python infra/bots/assets/android_ndk_darwin/download.py -t /tmp/ndk
+
+When generating your GN build files, pass the path to your `ndk` and your
+desired `target_cpu`:
+
+<!--?prettify lang=sh?-->
+
+ gn gen out/arm --args='ndk="/tmp/ndk" target_cpu="arm"'
+ gn gen out/arm64 --args='ndk="/tmp/ndk" target_cpu="arm64"'
+ gn gen out/mips64el --args='ndk="/tmp/ndk" target_cpu="mips64el"'
+ gn gen out/mipsel --args='ndk="/tmp/ndk" target_cpu="mipsel"'
+ gn gen out/x64 --args='ndk="/tmp/ndk" target_cpu="x64"'
+ gn gen out/x86 --args='ndk="/tmp/ndk" target_cpu="x86"'
+
+Other arguments like `is_debug` and `is_component_build` continue to work.