Skip to content

Instantly share code, notes, and snippets.

@thakursaurabh1998
Last active July 18, 2018 05:41
Show Gist options
  • Save thakursaurabh1998/cab92725a2255ef84312412696c9e35a to your computer and use it in GitHub Desktop.
Save thakursaurabh1998/cab92725a2255ef84312412696c9e35a to your computer and use it in GitHub Desktop.
Build task to compile and run C file for VS Code
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\Program Files (x86)\\Dev-Cpp\\MinGW64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build compile only"
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "build compile",
"type": "shell",
"command": "gcc \"${file}\" && ./a.exe",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "build run",
"type": "shell",
"command": "./a"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment