Skip to content

Instantly share code, notes, and snippets.

@abdoei
Created May 5, 2024 01:11
Show Gist options
  • Save abdoei/64cc670db37c6ed6fc0c2b9c811fcd7d to your computer and use it in GitHub Desktop.
Save abdoei/64cc670db37c6ed6fc0c2b9c811fcd7d to your computer and use it in GitHub Desktop.
Clang and GCC build(tasks) and debug(launch) files for my linux machine
{
"configurations": [
{
// Clang
"name": "C/C++: clang++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"existing": false,
"preLaunchTask": "C/C++: clang++ build active file",
"detail": "preLaunchTask: C/C++: clang++ build active file",
"taskDetail": "Task generated by Debugger.",
"taskStatus": "Recently Used Task",
"isDefault": true,
"miDebuggerPath": "/usr/bin/lldb-mi"
},
// GCC
{
"name": "C/C++: g++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++ build active file",
"detail": "preLaunchTask: C/C++: g++ build active file",
"taskDetail": "Task generated by Debugger.",
"taskStatus": "Recently Used Task",
"isDefault": true,
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
{
"tasks": [
{
// Clang
"type": "cppbuild",
"label": "C/C++: clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-fcolor-diagnostics",
"-fansi-escape-codes",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
},
// GCC
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment