Bug 15214

Summary: Add support for CMAKE_CROSSCOMPILING_EMULATOR to cmake.bbclass
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: devtools / tool chainAssignee: Adrian <adrian.freihofer>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: adrian.freihofer, meta.mr.watcher, meta.watcher, tgamblin
Version: 4.3   
Target Milestone: 5.99   
Hardware: All   
OS: Multiple   
Whiteboard: NEWCOMER
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

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