diff options
author | Mattijs Korpershoek <mkorpershoek@baylibre.com> | 2023-10-13 18:01:20 +0200 |
---|---|---|
committer | Mattijs Korpershoek <mkorpershoek@baylibre.com> | 2023-10-13 18:01:20 +0200 |
commit | 54401666eeb78e66bdc7f592251d1f92f6dac83f (patch) | |
tree | 1afedd8b2ddb4d1017e3ab6bbc8df33a01e0a63e | |
parent | e83bf7a15d35a677df64b781e2ff621aa9e72275 (diff) |
WIP: start documentation effort
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
-rw-r--r-- | Documentation/guides/android.rst | 52 | ||||
-rw-r--r-- | Documentation/index.rst | 1 |
2 files changed, 53 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 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 <sensor_driver_requirements> Lens driver requirements <lens_driver_requirements> Python Bindings <python-bindings> + Android guide <guides/android> |