Android#
Pigweed AI summary: The Android target for Pigweed supports building on devices using an Android Native Development Kit (NDK), but it is currently under construction and incomplete. To set up Pigweed, download and unpack the Android NDK and let Pigweed know where it is located using the pw_android_toolchain_NDK_PATH build argument. Build options can be set using gn args out. To build for the Pigweed target, build the top-level "android" Ninja target. To build for a specific CPU target and optimization
The Android target supports building Pigweed on devices using an Android Native Development Kit (NDK).
Warning
This target is under construction, not ready for use, and the documentation is incomplete.
Setup#
Pigweed AI summary: To set up Pigweed, you need to download and unpack the Android NDK and specify its location using the build argument pw_android_toolchain_NDK_PATH. You can also configure Pigweed build options using gn args out.
You must first download and unpack a copy of the Android NDK and let Pigweed
know where that is located using the pw_android_toolchain_NDK_PATH
build
arg.
You can set Pigweed build options using gn args out
.
Building#
Pigweed AI summary: To build Pigweed for Android, simply build the top-level "android" Ninja target. You can set Pigweed build options using "gn args out" or by running "gn gen out --args='pw_android_toolchain_NDK_PATH=\"/path/to/android/ndk\"'" on a Windows machine. Then build with "ninja -C out android" to build Pigweed for all supported Android CPU targets at the default optimization level. To build for a specific CPU target only, use "
To build for this Pigweed target, simply build the top-level “android” Ninja
target. You can set Pigweed build options using gn args out
or by running:
gn gen out --args='
pw_android_toolchain_NDK_PATH="/path/to/android/ndk"'
On a Windows machine it’s easier to run:
gn args out
That will open a text file where you can paste the args in:
pw_android_toolchain_NDK_PATH = "/path/to/android/ndk"
Save the file and close the text editor.
Then build with:
ninja -C out android
This will build Pigweed for all supported Android CPU targets at the default optimization level, currently arm, arm64, x64, and x86.
To build for a specific CPU target only, at the default optimization level:
ninja -C out arm64_android
Or to build for a specific CPU target and optimization level:
ninja -C out arm64_android_size_optimized