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
This commit is contained in:
parent
7957872f39
commit
adbd480102
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user