Skip to content

Add cmake.selectBuildAndLaunchTarget command to set both targets simultaneously - #4732

Merged
snehara99 merged 5 commits into
mainfrom
copilot/add-build-launch-target-command
Feb 23, 2026
Merged

snehara99 merged 5 commits into
mainfrom
copilot/add-build-launch-target-command

Conversation

Copilot AI commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

This change addresses item #4466

This changes visible behavior

The following changes are proposed:

  • Add selectBuildAndLaunchTarget method to CMakeProject that calls setLaunchTargetByName then setDefaultBuildTarget with the selected target name
  • Add corresponding ExtensionManager wrapper and register selectBuildAndLaunchTarget in the command funs array
  • Add cmake.selectBuildAndLaunchTarget command definition and command palette entry in package.json
  • Add localized title string "Set Build and Launch/Debug Target" in package.nls.json
  • Add changelog entry under 1.23 Features in CHANGELOG.md citing PR Add cmake.selectBuildAndLaunchTarget command to set both targets simultaneously #4732

The purpose of this change

Setting a launch target almost always requires updating the build target to match. This adds a single command (CMake: Set Build and Launch/Debug Target in the Command Palette) that shows the executable target picker and sets both the build and launch target to the selection.

Other Notes/Information

The new command reuses the existing setLaunchTargetByName flow (including reconfigure-if-needed, quick pick UI, single-target auto-select) and chains setDefaultBuildTarget on success. No new dependencies or settings introduced.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…s at once

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Copilot AI changed the title [WIP] Add command to set build and launch target simultaneously Feb 13, 2026
Copilot AI requested a review from snehara99 February 13, 2026 22:13
@kelteseth

Copy link
Copy Markdown

Copilot how about adding a third special build target similar to all and install called same_as_launch?

@snehara99

Copy link
Copy Markdown
Contributor

Copilot can you update the changelog under features citing this pr (#4732 )?

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

Copilot can you update the changelog under features citing this pr (#4732 )?

Added in a27d4f5 — new entry under 1.23 Features in CHANGELOG.md.

@snehara99

snehara99 commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

how about adding a third special build target similar to all and install called same_as_launch?

Hey Elias Steurer (@kelteseth), could you create a new issue detailing your suggestion a bit more? We'd be happy to take it but I need to first make sure it isn't conflicting with other suggestions we've received that are on our roadmap already.

@snehara99 snehara99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validated locally

@snehara99
snehara99 marked this pull request as ready for review February 23, 2026 16:59
@snehara99
snehara99 enabled auto-merge (squash) February 23, 2026 16:59
@snehara99
snehara99 merged commit 293a61e into main Feb 23, 2026
4 of 5 checks passed
@snehara99
snehara99 deleted the copilot/add-build-launch-target-command branch February 23, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants