vscode cmake插件的一些技巧
绝大部分可以通过cmake tools doc找到
https://github.com/microsoft/vscode-cmake-tools/blob/HEAD/docs/how-to.md#debug-a-project
快捷键
- 运行 shift + F5
- 调试 control+ F5
- 构建 F7
传入调试参数
.vscode/settings.json
"cmake.debugConfig": {
"args": ["arg1", "arg2"]
}
让cmake 配置 intellisense
.vscode/c_cpp_properties.json
{
"configurations": [
{
"name": "CMake",
"compileCommands": "${config:cmake.buildDirectory}/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
重新配置
control+shift+P然后选择cmake configure