summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@gmail.com>2023-12-31 16:48:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-12 11:34:05 +0000
commitf72759de573c97b291717cfe6043305b9797282e (patch)
tree36b352807957985b3537cbff8dad0ca9c3b13b96 /documentation
parent0b449adebe829bb671aa4330442a1651a356f6c2 (diff)
downloadpoky-f72759de573c97b291717cfe6043305b9797282e.tar.gz
ref-manual: document cmake-qemu class
(From yocto-docs rev: b2e396bd970ea8f27ba575b49c1489e2181442b8) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/ref-manual/classes.rst29
1 files changed, 29 insertions, 0 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 8d8bea4714..26d0e55cb4 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -377,6 +377,35 @@ If you need to install custom CMake toolchain files supplied by the application
377being built, you should install them (during :ref:`ref-tasks-install`) to the 377being built, you should install them (during :ref:`ref-tasks-install`) to the
378preferred CMake Module directory: ``${D}${datadir}/cmake/modules/``. 378preferred CMake Module directory: ``${D}${datadir}/cmake/modules/``.
379 379
380.. _ref-classes-cmake-qemu:
381
382``cmake-qemu``
383==============
384
385The :ref:`ref-classes-cmake-qemu` class might be used instead of the
386:ref:`ref-classes-cmake` class. In addition to the features provided by the
387:ref:`ref-classes-cmake` class, the :ref:`ref-classes-cmake-qemu` class passes
388the ``CMAKE_CROSSCOMPILING_EMULATOR`` setting to ``cmake``. This allows to use
389QEMU user-mode emulation for the execution of cross-compiled binaries on the
390host machine. For more information about ``CMAKE_CROSSCOMPILING_EMULATOR``
391please refer to the `related section of the CMake documentation
392<https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html>`__.
393
394Not all platforms are supported by QEMU. This class only works for machines with
395``qemu-usermode`` in the :ref:`ref-features-machine`. Using QEMU user-mode therefore
396involves a certain risk, which is also the reason why this feature is not part of
397the main :ref:`ref-classes-cmake` class by default.
398
399One use case is the execution of cross-compiled unit tests with CTest on the build
400machine. If ``CMAKE_CROSSCOMPILING_EMULATOR`` is configured::
401
402 cmake --build --target test
403
404works transparently with QEMU user-mode.
405
406If the CMake project is developed with this use case in mind this works very nicely.
407This also applies to an IDE configured to use ``cmake-native`` for cross-compiling.
408
380.. _ref-classes-cml1: 409.. _ref-classes-cml1:
381 410
382``cml1`` 411``cml1``