Bug 15214 - Add support for CMAKE_CROSSCOMPILING_EMULATOR to cmake.bbclass
Summary: Add support for CMAKE_CROSSCOMPILING_EMULATOR to cmake.bbclass
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 4.3
Hardware: All Multiple
: Medium enhancement
Target Milestone: 5.99
Assignee: Adrian
QA Contact:
URL:
Whiteboard: NEWCOMER
Depends on:
Blocks:
 
Reported: 2023-09-13 10:18 UTC by Ross Burton
Modified: 2024-01-14 09:52 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2023-09-13 10:18:29 UTC
CMake can build and run code at configure time with the try_run() function:

https://cmake.org/cmake/help/latest/command/try_run.html

Predictably, this fails when cross-compiling.

CMake does have support for an emulator (such as qemu) with the CMAKE_CROSSCOMPILING_EMULATOR variable:

https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html

We should support this in cmake.bbclass.
Comment 1 Adrian 2023-09-22 06:41:54 UTC
Would you like to implement it differently than it is implemented by the patch here:
https://patchwork.yoctoproject.org/project/oe-core/patch/20230910161850.4032227-3-adrian.freihofer@siemens.com/ ?
Comment 2 Ross Burton 2023-09-25 10:16:01 UTC
Yeah that looks good :)
Comment 3 Randy MacLeod 2023-10-24 14:24:23 UTC
Bulk move from 4.99 or 0.00 to 5.99
Comment 4 Adrian 2024-01-14 09:52:33 UTC
Implementated:

- implementation: d7c05e4eed4ed436f2ce961df46f9654af83ffec
- tests: 2df986746b4010a24def7369f356b50e52bda50d..85f84b4090f3fc84b377d37a18af7e4cb1b78f69
- docs: f72759de573c97b291717cfe6043305b9797282e