($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Adrian Freihofer <adrian.freihofer@gmail.com>
To: docs@lists.yoctoproject.org
Cc: Adrian Freihofer <adrian.freihofer@siemens.com>
Subject: [PATCH] ref-manual: document cmake-qemu class
Date: Sun, 31 Dec 2023 16:48:43 +0100	[thread overview]
Message-ID: <20231231154843.1418654-1-adrian.freihofer@siemens.com> (raw)

(From yocto-docs rev: d7c05e4eed4ed436f2ce961df46f9654af83ffec)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 documentation/ref-manual/classes.rst | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index a8afe9f2dcb..c9bc0f08c6c 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -377,6 +377,33 @@ If you need to install custom CMake toolchain files supplied by the application
 being built, you should install them (during :ref:`ref-tasks-install`) to the
 preferred CMake Module directory: ``${D}${datadir}/cmake/modules/``.
 
+.. _ref-classes-cmake-qemu:
+
+``cmake-qemu``
+==============
+
+The :ref:`ref-classes-cmake-qemu` class might be used instead of the
+:ref:`ref-classes-cmake` class. In addition to the features provided by the
+:ref:`ref-classes-cmake` class the :ref:`ref-classes-cmake-qemu` class passes
+the ``CMAKE_CROSSCOMPILING_EMULATOR`` setting to ``cmake``. This allows to use
+qemu-usermode for the execution of cross-compiled binaries on the host machine.
+For more information about ``CMAKE_CROSSCOMPILING_EMULATOR`` please refer to
+the `related section of the CMake documentation <https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html>`__.
+
+Not all platforms are supported by Qemu. This class only works for machines with
+the ``qemu-usermode`` in the :ref:`ref-features-machine`. Using qemu-usermode therefore
+involves a certain risk, which is also the reason why this feature is not part of
+the main cmake class by default.
+
+One use case is the execution of cross-compiled unit tests with CTest on the build
+machine. If ``CMAKE_CROSSCOMPILING_EMULATOR`` is configured::
+
+   cmake --build --target test
+
+works transparently with qemu-usermode.
+If the CMake project is developed with this use case in mind this works very nicely
+also out of an IDE configured to use cmake-native for cross compiling.
+
 .. _ref-classes-cml1:
 
 ``cml1``
-- 
2.43.0



             reply	other threads:[~2023-12-31 15:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-31 15:48 Adrian Freihofer [this message]
2024-01-08 16:23 ` [docs] [PATCH] ref-manual: document cmake-qemu class Michael Opdenacker
2024-01-08 22:24   ` adrian.freihofer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231231154843.1418654-1-adrian.freihofer@siemens.com \
    --to=adrian.freihofer@gmail.com \
    --cc=adrian.freihofer@siemens.com \
    --cc=docs@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).