Cross-Compile builds and executing tests on embedded/android targets? i.e. firmware.elf flash + run with gdb

Looking for ideas if/as there may be somethign wihtin Cmake that could make Cross-Compiled test execution simpler/viable?

As it stands the output artefact cannot be executed on the host machine obviously, my first point of call is whether there is an extension point to configure the command that is used to run tests or execute binaries?

The only other ‘hack’ I thought of would be to create a host pc executable target which bootstraps the cross-compiled test process etc:

  • unitTests_elf = Cross-Compiled target
  • unitTests_host = Container executable that flashes unitTests_elf to target and gets output results

EDIT: I Should not that I don’t fully know how unitTests_host would work at the moment and its just a concept of an idea so pointers there welcome too!

You’re probably looking for the CMAKE_CROSSCOMPILING_EMULATOR variable, which provides the default value for the CROSSCOMPILING_EMULATOR target property.

1 Like

@craig.scott Thankyou for the help, I missed this in the docs and your pointer looks to be super valuable :smile: