summaryrefslogtreecommitdiff
path: root/Documentation/guides/android.rst
diff options
context:
space:
mode:
authorMattijs Korpershoek <mkorpershoek@baylibre.com>2023-10-13 18:01:20 +0200
committerMattijs Korpershoek <mkorpershoek@baylibre.com>2023-10-13 18:01:20 +0200
commit54401666eeb78e66bdc7f592251d1f92f6dac83f (patch)
tree1afedd8b2ddb4d1017e3ab6bbc8df33a01e0a63e /Documentation/guides/android.rst
parente83bf7a15d35a677df64b781e2ff621aa9e72275 (diff)
WIP: start documentation effort
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Diffstat (limited to 'Documentation/guides/android.rst')
-rw-r--r--Documentation/guides/android.rst52
1 files changed, 52 insertions, 0 deletions
diff --git a/Documentation/guides/android.rst b/Documentation/guides/android.rst
new file mode 100644
index 00000000..aedb6931
--- /dev/null
+++ b/Documentation/guides/android.rst
@@ -0,0 +1,52 @@
+.. SPDX-License-Identifier: CC-BY-SA-4.0
+
+Android
+=======
+
+Android is quite different from a traditional Linux distribution
+and comes with its own set of libraries.
+
+This guide targets libcamera developers who want to build-test the Android support.
+
+Cross-compilation
+-----------------
+
+.. code-block:: ini
+
+ [constants]
+ # TODO: edit these paths for your own locations
+ ndk = '/mnt/work/aosp/android-ndk-r26b'
+
+ # see: https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#target-selection
+ triple = 'x86_64-linux-android'
+ android_api_level = '33'
+ target = triple + android_api_level
+
+ toolchain = ndk / 'toolchains/llvm/prebuilt/linux-x86_64/bin'
+
+ [properties]
+ cpp_stdlib = 'vndk'
+
+ [built-in options]
+ cpp_args = ['-target', target]
+
+ [binaries]
+ c = toolchain / target + '-clang'
+ cpp = toolchain / target + '-clang++'
+ ar = toolchain / 'llvm-ar'
+ strip = toolchain / 'llvm-strip'
+ config = toolchain / 'llvm-config'
+
+ [host_machine]
+ system = 'linux'
+ cpu_family ='x86_64'
+ cpu = 'amd64'
+ endian = 'little'
+
+1. Edit the ``ndk`` constant to point to your system's NDK location
+
+2. Save the above cross file in ``~/.local/share/meson/cross/x86_64-linux-android.txt``.
+
+.. code::
+
+ meson setup --cross-file=x86_64-linux-android.txt --prefix=/ -Dandroid=enabled -Dandroid_platform=generic -Dpipelines=simple build; meson compile -C build