首页 > 其他分享 >VScode 一键编译

VScode 一键编译

时间:2022-09-18 20:12:51浏览次数:120  
标签:false VScode 一键 fileBasenameNoExtension 编译 file group label true

{
	// See https://go.microsoft.com/fwlink/?LinkId=733558
	// for the documentation about the tasks.json format
	"version": "2.0.0",
	"tasks": [
		{
			"label": "No terminal CR",
			"type": "shell",
			"command": "g++ ${file} -o ${fileBasenameNoExtension} && ./${fileBasenameNoExtension} < f.in > f.out",
			"problemMatcher": {
				"owner": "cpp",
				"fileLocation": [
					"relative",
					"./"
				],
				"pattern": {
					"regexp": "^(.*):([0-9]+):([0-9]+): (.*): (.*)$",
					"file": 1,
					"line": 2,
					"column": 3,
					"severity": 4,
					"message": 5
				}
			},
			"presentation": {
				"echo": true,
				"reveal": "never",
				"focus": false,
				"panel": "shared",
				"showReuseMessage": true,
				"clear": false
			},
			"group": {
				"kind": "build",
				"isDefault": true
			}
		},
		{
			"label": "Terminal Compile",
			"type": "shell",
			"command": "gnome-terminal -x bash -c \"bash | g++ ${file} -o ${fileBasenameNoExtension}\"",
			"presentation": {
				"reveal": "never"
			},
			"group": "build",
			"problemMatcher": []
		},
		{
			"label": "No terminal CR -fsanitize",
			"type": "shell",
			"command": "g++ ${file} -o ${fileBasenameNoExtension} -fsanitize=address,undefined && ./${fileBasenameNoExtension} < f.in > f.out",
			"problemMatcher": {
				"owner": "cpp",
				"fileLocation": [
					"relative",
					"./"
				],
				"pattern": {
					"regexp": "^(.*):([0-9]+):([0-9]+): (.*): (.*)$",
					"file": 1,
					"line": 2,
					"column": 3,
					"severity": 4,
					"message": 5
				}
			},
			"presentation": {
				"echo": true,
				"reveal": "never",
				"focus": false,
				"panel": "shared",
				"showReuseMessage": true,
				"clear": false
			},
			"group": "build"
		},
		{
			"label": "No terminal CR O2",
			"type": "shell",
			"command": "g++ ${file} -o ${fileBasenameNoExtension} -O2 && ./${fileBasenameNoExtension} < f.in > f.out",
			"problemMatcher": {
				"owner": "cpp",
				"fileLocation": [
					"relative",
					"./"
				],
				"pattern": {
					"regexp": "^(.*):([0-9]+):([0-9]+): (.*): (.*)$",
					"file": 1,
					"line": 2,
					"column": 3,
					"severity": 4,
					"message": 5
				}
			},
			"presentation": {
				"echo": true,
				"reveal": "never",
				"focus": false,
				"panel": "shared",
				"showReuseMessage": true,
				"clear": false
			},
			"group": "build"
		}
	]
}

标签:false,VScode,一键,fileBasenameNoExtension,编译,file,group,label,true
From: https://www.cnblogs.com/cdsidi/p/16705610.html

相关文章