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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745153965a4614005.html
评论列表(0条)