Files
tqma6-yocto-mirror/sources/poky/meta/classes-recipe/cmake-qemu.bbclass
Siggi (OpenClaw Agent) 16accb6b24 Complete Yocto mirror with license table for TQMa6UL (2038-compliance)
- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
2026-03-01 21:14:11 +00:00

33 lines
1.5 KiB
Plaintext

#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: MIT
#
# Not all platforms are supported by Qemu. Using qemu-user 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_EXEWRAPPER_ENABLED is configured,
# cmake --build --target test
# works transparently with qemu-user. 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.
inherit qemu cmake
DEPENDS:append:class-target = "${@' qemu-native' if bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', True, False, d) else ''}"
cmake_do_generate_toolchain_file:append:class-target() {
if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true', 'false', d)}; then
# Write out a qemu wrapper that will be used as exe_wrapper so that cmake
# can run target helper binaries through that. This also allows to execute ctest.
qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_HOST}', ['${STAGING_DIR_HOST}/${libdir}','${STAGING_DIR_HOST}/${base_libdir}'])}"
echo "#!/bin/sh" > "${WORKDIR}/cmake-qemuwrapper"
echo "$qemu_binary \"\$@\"" >> "${WORKDIR}/cmake-qemuwrapper"
chmod +x "${WORKDIR}/cmake-qemuwrapper"
echo "set( CMAKE_CROSSCOMPILING_EMULATOR ${WORKDIR}/cmake-qemuwrapper)" \
>> ${WORKDIR}/toolchain.cmake
fi
}