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

**URL:** https://discourse.cmake.org/t/cross-compile-builds-and-executing-tests-on-embedded-android-targets-i-e-firmware-elf-flash-run-with-gdb/4217
**Category:** Usage
**Tags:** os:windows
**Created:** [October 6, 2021, 12:52pm UTC](https://discourse.cmake.org/t/cross-compile-builds-and-executing-tests-on-embedded-android-targets-i-e-firmware-elf-flash-run-with-gdb/4217 "2021-10-06T12:52:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![CraigEmteq](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craigemteq/32/1229_2.png) [@CraigEmteq](https://discourse.cmake.org/u/CraigEmteq)
#### Post date: [October 6, 2021, 12:52pm UTC](https://discourse.cmake.org/t/cross-compile-builds-and-executing-tests-on-embedded-android-targets-i-e-firmware-elf-flash-run-with-gdb/4217/1 "2021-10-06T12:52:47Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [October 6, 2021, 9:18pm UTC](https://discourse.cmake.org/t/cross-compile-builds-and-executing-tests-on-embedded-android-targets-i-e-firmware-elf-flash-run-with-gdb/4217/2 "2021-10-06T21:18:34Z")

</div>

You’re probably looking for the [CMAKE\_CROSSCOMPILING\_EMULATOR](https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html) variable, which provides the default value for the [CROSSCOMPILING\_EMULATOR](https://cmake.org/cmake/help/latest/prop_tgt/CROSSCOMPILING_EMULATOR.html) target property.

---

<div class="post-metadata">

### Author: ![CraigEmteq](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craigemteq/32/1229_2.png) [@CraigEmteq](https://discourse.cmake.org/u/CraigEmteq)
#### Post date: [October 8, 2021, 9:32am UTC](https://discourse.cmake.org/t/cross-compile-builds-and-executing-tests-on-embedded-android-targets-i-e-firmware-elf-flash-run-with-gdb/4217/3 "2021-10-08T09:32:38Z")

</div>

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