Skip to content

Instantly share code, notes, and snippets.

@An1MuS1111
Created November 12, 2022 10:07
Show Gist options
  • Select an option

  • Save An1MuS1111/5b5da4bebd80aa4b7452eeb27453fccb to your computer and use it in GitHub Desktop.

Select an option

Save An1MuS1111/5b5da4bebd80aa4b7452eeb27453fccb to your computer and use it in GitHub Desktop.

An1MuS .vscode Settings

1. C++ (mac):

  • launch.json

{
    "configurations": [
        {
            "name": "Console program",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "lldb",
            "preLaunchTask": "single_file_graphic_build"
        },{
            "name": "Multi-file Console program",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/${workspaceFolderBasename}",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "lldb",
            "preLaunchTask": "multi_file_console_build"
        }
    
    ]
}
  • task.json

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "single_file_graphic_build",
            "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."
        },{
            "label": "multi_file_console_build",
            "type": "shell",
            "command": "g++",
            "args": [
                "-g",
                "*.cpp",
                "-o",
                "${workspaceFolderBasename}"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": "$gcc"
        }
    ],
    "version": "2.0.0"
}
  • 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": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "macos-clang-arm64"
        }
    ],
    "version": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment