-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake builds launch target once per every "${command:cmake.launchTargetXXX}" reference #1487
Comments
Yeah, that's pretty bad. It seems that the underlying cause is simply that a function written with the intent to prepare binaries for debug/launch was reused to get the current launch target. If you need a quick fix before we update the extension, you can patch the line 42520 would change from |
Sorry about that. I meant to reply back and say that my suggestion wouldn't work for some cases because this function is called in some other scenarios that I didn't realize. I was working on an alternate fix but got pulled away into a few meetings. You'll want to revert any code changes you made in main.js for now. |
Regarding documentation, I thought we had documented this, but I'm not finding a specific page for it. I think we should update cmake-settings.md and add all the supported commands. I also see some references in debug-launch.md The %% showing in the feature contributions is a vscode bug. microsoft/vscode#54111 |
Well, we tried, no worries. But while we're at it, I have a suggestion for a new command: |
This should be fixed in CMake Tools 1.5.0 which was published today. |
Brief Issue Summary
It seems that
${command:cmake.launchTargetDirectory}
,${command:cmake.launchTargetFilename}
and${command:cmake.launchTargetPath}
are evaluated more than once when launching a configuration. Whencmake.buildBeforeRun
istrue
these commands will ensure that launch target exists before evaluating its properties, but the unfortunate side-effect is that the target will get built once per each command reference. This means that if you reference all 3 of them in a launch configuration inlaunch.json
and then once again within thepreLaunchTask
intasks.json
, your launch target will get built 6 (six) times! And all 6 times you get full output text as well as extension pop-ups about compiling.I guess this may have been implemented like this for simplicity, but I would still optimize this down to building the launch target exactly once when
cmake.buildBeforeRun
istrue
. I believe it should be possible since CMake Tools is fully in charge of the build process.The text was updated successfully, but these errors were encountered: