C++/๊ธฐํƒ€

[C++] vscode ๋””๋ฒ„๊น… ์„ธํŒ… ๊ธฐ๋ก

Chan Lee 2023. 12. 23. 17:44

2023.12.23 ๊ธฐ์ค€

M2 MAC

 

๋””๋ฒ„๊น… ๊ด€๋ จ ํŒŒ์ผ๋“ค ๊ธฐ๋ก

codelldb extension ์‚ฌ์šฉ ์ค‘

 

//c_cpp_properties.json

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "macos-clang-arm64"
        }
    ],
    "version": 4
}
// launch.json
{    
    "version": "0.2.0",         
    "configurations": [                
        {                   
            "type": "lldb",
            "request": "launch", 
            "name": "Debug",  
            "program": "${fileDirname}/${fileBasenameNoExtension}", 
            "args": [],                        
            "cwd": "${fileDirname}"               
         }    
    ]
}
// tasks.json
{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: clang++ ํ™œ์„ฑ ํŒŒ์ผ ๋นŒ๋“œ",
            "command": "/usr/bin/clang++",
            "args": [
                "-std=c++20",
                "-fcolor-diagnostics",
                "-fansi-escape-codes",
                "-gdwarf-2",
                "${fileDirname}/**.cpp",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "์ปดํŒŒ์ผ๋Ÿฌ: /usr/bin/clang++"
        },
        {
            "type": "cppbuild",
            "label": "C/C++: g++ ํ™œ์„ฑ ํŒŒ์ผ ๋นŒ๋“œ",
            "command": "/usr/bin/g++",
            "args": [
                "-fdiagnostics-color=always",
                "-gdwarf-2",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build",
            "detail": "๋””๋ฒ„๊ฑฐ์—์„œ ์ƒ์„ฑ๋œ ์ž‘์—…์ž…๋‹ˆ๋‹ค."
        },
        {
            "type": "cppbuild",
            "label": "C/C++: clang++ ํ™œ์„ฑ ํŒŒ์ผ ๋นŒ๋“œ",
            "command": "/usr/bin/clang++",
            "args": [
                "-fcolor-diagnostics",
                "-fansi-escape-codes",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build",
            "detail": "์ปดํŒŒ์ผ๋Ÿฌ: /usr/bin/clang++"
        }
    ]
}