【发布时间】:2021-07-07 16:22:01
【问题描述】:
我是 VS 代码的新手。我已经使用提供的 [VS 代码文档] (https://code.visualstudio.com/docs/cpp/config-clang-mac) 在 macOS 上使用 Clang 配置它
它有效,我可以构建和调试。太好了!
我的问题是:如何配置 VS Code 以在发布模式下构建?我似乎无法在文档或有关如何操作的教程中找到任何信息
如果有帮助,这就是 tasks.json 现在的样子
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-std=c++17",
"-stdlib=libc++",
"-g",
"-v",
"${file}",
"${workspaceFolder}/source/*.cpp",
"${workspaceFolder}/FFTreal/*.cpp",
"-I.",
"-L",
"${workspaceFolder}/BassLibrary",
"-lbass",
"-o",
"${workspaceFolder}/final.out",
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": ["$gcc"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
有什么想法吗?谢谢!
【问题讨论】:
标签: c++ visual-studio-code build clang release-mode