diff options
| author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2023-12-31 16:48:43 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-12 11:34:05 +0000 |
| commit | f72759de573c97b291717cfe6043305b9797282e (patch) | |
| tree | 36b352807957985b3537cbff8dad0ca9c3b13b96 | |
| parent | 0b449adebe829bb671aa4330442a1651a356f6c2 (diff) | |
| download | poky-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>
| -rw-r--r-- | documentation/ref-manual/classes.rst | 29 |
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 | |||
| 377 | being built, you should install them (during :ref:`ref-tasks-install`) to the | 377 | being built, you should install them (during :ref:`ref-tasks-install`) to the |
| 378 | preferred CMake Module directory: ``${D}${datadir}/cmake/modules/``. | 378 | preferred CMake Module directory: ``${D}${datadir}/cmake/modules/``. |
| 379 | 379 | ||
| 380 | .. _ref-classes-cmake-qemu: | ||
| 381 | |||
| 382 | ``cmake-qemu`` | ||
| 383 | ============== | ||
| 384 | |||
| 385 | The :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 | ||
| 388 | the ``CMAKE_CROSSCOMPILING_EMULATOR`` setting to ``cmake``. This allows to use | ||
| 389 | QEMU user-mode emulation for the execution of cross-compiled binaries on the | ||
| 390 | host machine. For more information about ``CMAKE_CROSSCOMPILING_EMULATOR`` | ||
| 391 | please refer to the `related section of the CMake documentation | ||
| 392 | <https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html>`__. | ||
| 393 | |||
| 394 | Not 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 | ||
| 396 | involves a certain risk, which is also the reason why this feature is not part of | ||
| 397 | the main :ref:`ref-classes-cmake` class by default. | ||
| 398 | |||
| 399 | One use case is the execution of cross-compiled unit tests with CTest on the build | ||
| 400 | machine. If ``CMAKE_CROSSCOMPILING_EMULATOR`` is configured:: | ||
| 401 | |||
| 402 | cmake --build --target test | ||
| 403 | |||
| 404 | works transparently with QEMU user-mode. | ||
| 405 | |||
| 406 | If the CMake project is developed with this use case in mind this works very nicely. | ||
| 407 | This 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`` |
