microsoft / microsoft/vscode-cmake-tools
[Feature] Executable file should be found even if CMAKE_BUILD_TYPE is not specified
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 546
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 32
Description
### Request Overview
**Executive request**: Command `cmake.launchTargetPath` should always return positive information when *CMake generation* and *build* is successful, regardless of `CMAKE_BUILD_TYPE` config.
---
Full version:
I have reported the, IMO, [a bug](https://github.com/microsoft/vscode-cmake-tools/issues/4448) where CMake command `${command:cmake.launchTargetPath}` reports the *No executable target was found to launch* when `CMAKE_BUILD_TYPE` is not specified in the *CMake Presets* configuration.
There is no apparent reason why such a definition should be present in the preset and why it doesn't need to be present in the non-preset configuration. cf @gcampbell-msft https://github.com/microsoft/vscode-cmake-tools/issues/4448#issuecomment-2867325813
> I believe this is one of those gray areas where one could argue that we should have a default here, but the stance of the extension for a long time for Presets has been that CMAKE_BUILD_TYPE should be defined explicitly, based on the docs that you linked since it defaults to an empty string, which often isn't desirable. In this case, I think the stance of the extension is that it should be defined.
I do not understand how are the *output executable* and the `CMAKE_BUILD_TYPE` linked together. If CMake is able to generate the build system, and if build system succeeds (executable is generated), then `${command:cmake.launchTargetPath}` should succeed.
### Additional Information
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the cmake.launchTargetPath command and its handling of CMake Presets, then reproduce the case with CMAKE_BUILD_TYPE omitted after successful generation and build. The change is done when the command returns the generated executable in that configuration as well as when CMAKE_BUILD_TYPE is specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, typescript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100