Environment Configuration - llHoYall/Cpp_Playground GitHub Wiki

CMake

$ brew install cmake

$ sudo apt install -y cmake

$ choco install cmake

LLVM/Clang

$ sudo apt install -y clang

$ choco install llvm

VSCode

Installation

C/C++

ext install ms-vscode.cpptools

CMake

ext install twxs.cmake

Native Debug

ext install webfreak.debug

LLDB를 사용하려면 lldb-mi가 path에 등록되어 있어야 한다.

MAC OSX를 사용한다면, 다음과 같이 link를 만든다.

$ ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi /usr/local/bin/lldb-mi

Configuration

c_cpp_properties.json

{
  "configurations": [
    {
      "name": "Mac",
      "includePath": ["${workspaceFolder}/**"],
      "defines": [],
      "macFrameworkPath": ["/System/Library/Frameworks", "/Library/Frameworks"],
      "compilerPath": "/usr/bin/clang",
      "cStandard": "c11",
      "cppStandard": "c++17",
      "intelliSenseMode": "clang-x64"
    }
  ],
  "version": 4
}

tasks.json

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "build",
      "type": "shell",
      "options": {
	"cwd": "${workspaceRoot}/<path>"
      },
      "command": "mkdir build && cd build && cmake .. && make",
      "group": "build"
    },
    {
      "label": "clean",
      "type": "shell",
      "command": "rm -rf **/build"
    }
  ]
}

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug",
      "type": "lldb-mi",
      "request": "launch",
      "target": "<executable>",
      "cwd": "${workspaceRoot}/<path>"
    }
  ]
}
⚠️ **GitHub.com Fallback** ⚠️