Configuration

Configuration #

.vscode #

This directory contains configuration files for Visual Studio Code to set up the development environment for C++ projects. These files should be placed inside the .vscode folder at the root of your project.

c_cpp_properties.json #

// .vscode/c_cpp_properties.json
{
  "configurations": [
    {
      "name": "Mac",
      "includePath": ["${workspaceFolder}/**"],
      "defines": [],
      "macFrameworkPath": [
        "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
      ],
      "compilerPath": "/usr/bin/clang",
      "cStandard": "c11",
      "cppStandard": "c++17",
      "intelliSenseMode": "macos-clang-arm64",
      "compilerArgs": [
        "-DLOCAL",
        "-std=c++17",
        "-Wall",
        "-Wextra",
        "-Wshadow",
        "-Wconversion"
      ]
    }
  ],
  "version": 4
}

lanuch.json #

// .vscode/lanuch.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "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
        }
      ],
      "preLaunchTask": "C/C++: clang++ build active file"
    }
  ]
}

tasks.json #

// .vscode/tasks.json
{
  "tasks": [
    {
      "type": "cppbuild",
      "label": "C/C++: clang++ build active file",
      "command": "/usr/bin/clang++",
      "args": [
        "-fcolor-diagnostics",
        "-fansi-escape-codes",
        "-g",
        "${file}",
        "-DLOCAL",
        "-std=c++17",
        "-Wall",
        "-Wextra",
        "-Wshadow",
        "-Wconversion",
        "-o",
        "${fileDirname}/${fileBasenameNoExtension}"
      ],
      "options": {
        "cwd": "${fileDirname}"
      },
      "problemMatcher": ["$gcc"],
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "detail": "Task generated by Debugger."
    }
  ],
  "version": "2.0.0"
}