跳到正文

个人记录

`tasks.json` 配置

zhiyin123约 4 分钟
原文
文章信息与版本

文章信息

发布
2024年11月18日
收录
2025年12月12日
更新
2026年11月18日
篇幅
约 4 分钟

版本

  1. v1当前
JSON
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Debug",
            "command": "/usr/bin/g++",
            "type": "shell",
            "args": [
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}",
                "-std=c++14",
                "-lm",
                "-Wall",
                "-fsanitize=address,undefined"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [],
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": true
            },
            "group": "build"
        },
        {
            "label": "Release",
            "command": "/usr/bin/g++",
            "type": "shell",
            "args": [
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}",
                "-std=c++14",
                "-lm",
                "-Wall",
                "-O2",
                "-ulimit"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [],
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": true
            },
            "group": "build"
        },
        {
            "label": "Run",
            "command": "/usr/bin/time",
            "type": "shell",
            "args": [
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [],
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": true
            },
            "group": "build"
        }
    ]
}
原文