vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

Use CMAKE_CROSSCOMPILING_EMULATOR to run cross compiled executables

Open DexterMagnific opened this issue 7 years ago • 3 comments

Brief Issue Summary

When a program is cross compiled and I try to run it (Run in terminal), CMakeTools run it directly without taking into consideration that there is an emulator set.

Example:

set(CMAKE_CROSSCOMPILING_EMULATOR ${CMAKE_SYSROOT}/tools/HEXAGON_Tools/8.0.10/Tools/bin/hexagon-sim FORCE "The simulator")

Expected:

The emulator should be used to run the executable

Apparent Behavior:

The executable is run directly on the host system

Platform and Versions

**Operating System**: Linux
**CMake Version**: 3.10.2
**VSCode Version**: 1.27.2
**CMake Tools Extension Version**: 1.1.2
**Compiler/Toolchain**: Custom (Based on CLang 3.9.0)

DexterMagnific avatar Oct 03 '18 14:10 DexterMagnific

Good idea! I'll add it to 1.2.0.

vector-of-bool avatar Oct 10 '18 04:10 vector-of-bool

Is there any news on this issue?

I would really love to have it. In combination with docker multi-platform support this would faciliate cross platform development extremely and give a great IDE experience.

In the meantime, is there any workaround to use an emulator when using VSCode and CMake with presets?

mbodmer avatar Jan 19 '23 15:01 mbodmer

Note that the CMAKE_ variable just initializes a target property (https://cmake.org/cmake/help/latest/prop_tgt/CROSSCOMPILING_EMULATOR.html), which would be the more proper thing to look at when deciding how to run a target.

david-fong avatar Oct 18 '25 02:10 david-fong