-
Notifications
You must be signed in to change notification settings - Fork 479
Task Provider for Cmake build tasks #1880
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
Conversation
993fb79
to
66a509e
Compare
src/cMakeTaskProvider.ts
Outdated
} | ||
} | ||
if (this.options?.cwd) { | ||
this.options.cwd = util.resolveVariables(this.options.cwd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you copied this over from cpptools. cmake-tools has it's own resolver. Look at expand.expandStringHelper
. To supply the opts
, do a FindAllReferences and see what the other functions are doing. There may be a way to make this better in the future (e.g. pass in a driver or extension object and we'll fill it out for you), but that would be for a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in future we can use expandStringHelper(str, this.cmakeDriver.expansionOptions)
to resolve variables other than cwd
.
currently vscode resolves cwd
in resolveTask
.
I just saw this new feature being available in 1.8.0, great addition. It would be nice also to be able to set the "target" in the task definition. |
We talked about this and kept it "out of scope" for this PR, but I don't think an issue was opened to track it. Thank you for the suggestion. We'll open an issue now. |
feature-request fix: #1656
the defined task:
Invoke :
"Task: Run build Task"
and choose theCMake: cmake example
task:a build finished with error (target is chosen from the user defined target)

a build finished successfully (here the project was not configured yet and the target is set to all by default)

and this is a successful build after changing target:
