admin管理员组文章数量:1415491
I currently have a tasks.json
task which does a CMake debug build via terminal commands:
"label": "LCD",
"type": "shell",
"command": "cmake -S . -B ./cmake/dbg -DCMAKE_BUILD_TYPE=Debug; cmake --build ./cmake/dbg --config Debug",
For release builds, I have a different task:
"label": "LCR",
"type": "shell",
"command": "cmake -S . -B ./cmake/rel -DCMAKE_BUILD_TYPE=Release; cmake --build ./cmake/rel --config Release"
Corresponding to a debug or release code that I am working on/going to run, I have corresponding configurations in c_cpp_properties.json
{
"name": "LCD",
"compileCommands": "${workspaceFolder}/cmake/dbg/compile_commands.json"
},
{
"name": "LCR",
"compileCommands": "${workspaceFolder}/cmake/rel/compile_commands.json"
}
Currently, I manually choose either of these configurations (via VSCode command C_Cpp.ConfigurationSelect
so that the correct compile_commands.json
can be used for intellisense/highlighting of code, etc.
Is there a way to pass the VSCode command of having the LCD
configuration be selected automatically when task LCD
is run?
XPost in vscode-cpptools
本文标签: visual studio codeChange CCppConfigurationSelect via tasksjsonStack Overflow
版权声明:本文标题:visual studio code - Change C_Cpp.ConfigurationSelect via tasks.json - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745153965a2645057.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论