From 54401666eeb78e66bdc7f592251d1f92f6dac83f Mon Sep 17 00:00:00 2001 From: Mattijs Korpershoek Date: Fri, 13 Oct 2023 18:01:20 +0200 Subject: WIP: start documentation effort Signed-off-by: Mattijs Korpershoek --- Documentation/guides/android.rst | 52 ++++++++++++++++++++++++++++++++++++++++ Documentation/index.rst | 1 + 2 files changed, 53 insertions(+) create mode 100644 Documentation/guides/android.rst 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 diff --git a/Documentation/index.rst b/Documentation/index.rst index 43d8b017..ce51a8f6 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst @@ -23,3 +23,4 @@ Sensor driver requirements Lens driver requirements Python Bindings + Android guide -- cgit v1.2.1