visual-studio-code - 自上次编译以来,如何让 VS Code 跳过源文件而没有任何更改?
问题描述
Eclipse CDT 可以自动编译项目目录中所有更改的源文件(如果有)并链接它们。然而,默认的“C/C++:g++.exe 构建活动文件”任务将始终编译该文件,即使自上次编译以来没有任何更改。是的,可以通过make文件来完成。除此之外,VSC 或其扩展是否提供了一些更简单的方法来做到这一点?
这是我的 tasks.json 的样子:
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++.exe build active file",
"command": "\"${config:task.gccpath}/g++.exe\"",
"args": [
"-Wall",
"-g",
"${file}",
"-o",
"${workspaceFolder}/Debug/${relativeFileDirname}/${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${config:task.gccpath}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: ${config:task.gccpath}/g++.exe"
}
]
}
这是我的 launch.json 的样子
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/Debug/${relativeFileDirname}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/IO/${relativeFileDirname}/",
"environment": [],
"console": "externalTerminal",
"MIMode": "gdb",
"miDebuggerPath": "${config:task.gccpath}/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++.exe build active file"
}
]
}
解决方案
推荐阅读
- javascript - 我希望当对象悬停时,应该运行一个 JS 函数,但它会在页面加载时立即运行
- r - 如何评估 R 中的 kmeans 聚类性能
- bash - 如果分支没有最新的 master,Azure 构建失败
- twig - Symfony 5 和 opache 的 Twig 缓存问题
- python - 请求的输出格式“s16le”不是 discord.py 中合适的输出格式
- java - 如何为每个控制器设置不同的基本 url
- plugins - 右键单击项目
- snowflake-cloud-data-platform - 雪花:通过插入值添加多个值时面临问题
- python - 使用获取的结果选择数据框中的列
- web-config - 每天在 web.config 中自动更改 connString