microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.47k stars 451 forks source link

The logic of the run button is incorrect #3293

Open JiahaoCodes opened 1 year ago

JiahaoCodes commented 1 year ago

Brief Issue Summary

Windows version: windows 10 22H2 VS Code version: 1.81.0 CMake tools version: 1.61.0 When using the CMake extension, if I launch an executable using the start button on the status bar, according to the normal usage logic, the CMake extension should only compile the executable and its related build options. However, the extensionalso compiles the selected build options in the build button, which clearly contradicts the usual usage habit and expectation. As shown in the figure below, I have selected the program "camera_with_mouse" to run. In the build options, I have selected "camera_practice_two". Based on the output, it can be seen that CMake Tools compiled both of the above options. However, the executable program in the build option does not require compilation. image

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

gcampbell-msft commented 1 year ago

Thanks for the post @SAquarius!

I have been able to repro, and it seems like the issue is similar to what you have stated, upon attempting to run the target, we attempt to build in order to ensure that the target is built. However, this may cause confusing behavior if you have a situation like the one you are describing.

Marking this as a bug and putting it in our backlog.

H-G-Hristov commented 11 months ago

I hope that instead of fixing this, the run and debug logic will be merged with the vscode-cpptools seamlessly. I think there were feature requests to do that and even a member of MS made a ticket to do that.