Skip to content

Instantly share code, notes, and snippets.

@WunGCQ
Last active April 18, 2019 12:04
Show Gist options
  • Save WunGCQ/83de88952eb36e656b810819cac00637 to your computer and use it in GitHub Desktop.
Save WunGCQ/83de88952eb36e656b810819cac00637 to your computer and use it in GitHub Desktop.
VSCode OSX C++ cpp tasks.json launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (OSX)",
"type": "lldb",
"request": "launch",
"program": "${workspaceRoot}/Debug/out.o",
"MIMode": "lldb",
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"externalConsole": false,
"visualizerFile": "${workspaceRoot}/my.natvis"
}
]
}
// ${workspaceRoot} the path of the folder opened in VS Code
// ${workspaceRootFolderName} the name of the folder opened in VS Code without any slashes (/)
// ${file} the current opened file
// ${relativeFile} the current opened file relative to workspaceRoot
// ${fileBasename} the current opened file's basename
// ${fileBasenameNoExtension} the current opened file's basename without the extension
// ${fileDirname} the current opened file's dirname
// ${fileExtname} the current opened file's extension
// ${cwd} the task runner's current working directory on startup
{
"version": "0.1.0",
"command": "g++",
"args": ["-g","${file}","-o","${workspaceRoot}/Debug/out.o"], // 编译命令参数
"problemMatcher": "$msCompile"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment