Skip to content
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

Ability to pass custom target to "CMake: Build Target" command (aka cmake.buildWithTarget) as argument #3598

Open
i-ky opened this issue Feb 19, 2024 · 2 comments
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: build help wanted we currently are not planning work on this and would like help from the open source community
Milestone

Comments

@i-ky
Copy link
Contributor

i-ky commented Feb 19, 2024

Brief Issue Summary

I would like to configure a task which would depend on building a specific target. It is possible to call a command from a task using "inputs", tasks.json would look something like this:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Build Target",
      "command": "echo ${input:buildTarget}",
      "type": "shell",
      "problemMatcher": []
    }
  ],
  "inputs": [
    {
      "id": "buildTarget",
      "type": "command",
      "command": "cmake.buildWithTarget",
      "args": "targetName"
    }
  ]
}

Unfortunately, cmake.buildWithTarget does not support receiving target as argument, instead it unconditionally prompts user for target selection:

async buildWithTarget(): Promise<number> {
const target = await this.showTargetSelector();

This is not acceptable in my use case, because there is a specific target I want to build and I don't want to bother workspace users with target selection (which would be non-user-friendly and error-prone).

Could you please make cmake.buildWithTarget accept target as argument?

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@github-project-automation github-project-automation bot moved this to Triage Needed in CMake Tools Feb 19, 2024
@gcampbell-msft gcampbell-msft added enhancement an enhancement to the product that is either not present or an improvement to an existing feature help wanted we currently are not planning work on this and would like help from the open source community Feature: build and removed triage labels Feb 22, 2024
@gcampbell-msft gcampbell-msft added this to the Backlog milestone Feb 22, 2024
@gcampbell-msft
Copy link
Collaborator

@i-ky Thank you for the request / suggestion! I have placed it on the backlog, but if you want this feature quickly, we would certainly welcome an open-source contribution!

Thanks! 😊

@gcampbell-msft gcampbell-msft moved this to Pending Prioritization in CMake Tools Jul 17, 2024
@hippo91 hippo91 mentioned this issue Dec 7, 2024
@hippo91
Copy link
Contributor

hippo91 commented Dec 7, 2024

@i-ky i made the #4206 PR. It would be nice if you could test it to confirm it does the job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: build help wanted we currently are not planning work on this and would like help from the open source community
Projects
Status: Pending Prioritization
Development

No branches or pull requests

3 participants