microsoft / microsoft/vscode-cmake-tools
Add command substitution for getLaunchTarget so the current debug target name can be consumed in tasks.json
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 546
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 32
Description
This is a feature request.
Currently a list of CMake variables are available for command substitution in task commands, for example cmake.buildTargetName. Refer to https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/cmake-settings.md
While the build target name is exposed as substitution, the corresponding debug target name is not.
It would be beneficial to add a substitution for `getLaunchTarget` so the current debug target name is also available and can be consumed in tasks. This is very useful to support utility targets like code signing or embedded flash programming.
Please note, the getLaunchTargetFilename (equivalent to CMake API `nameOnDisk`) is already exposed, but this is a different value than the itself launchTarget (CMake API value `name`) and has the file extension .exe or .elf appended.
Contributor guide
Research direction
Start by tracing the existing command substitutions for cmake.buildTargetName and getLaunchTargetFilename, using docs/cmake-settings.md as the documented reference. Add the distinct getLaunchTarget substitution so tasks.json can consume the current debug target name rather than its on-disk filename, and verify the documented values remain distinct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, typescript
- Domain
- build-system, developer-experience
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100