microsoft / microsoft/vscode-cmake-tools

Use CMAKE_CROSSCOMPILING_EMULATOR to run cross compiled executables

Open
#554 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

embedded enhancement Feature: debug/launch
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### 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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the CMake Tools “Run in terminal” execution path and how it obtains CMake configuration variables. Reproduce the Linux cross-compilation case with CMAKE_CROSSCOMPILING_EMULATOR set, then verify that running the executable invokes the configured emulator rather than the host directly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.