dawn-cmake/.vscode/tasks.json
Ben Clayton 96a57f65dd .vscode/tasks.json: Make build & configure work for windows.
Have this use the gn build, as the CMake approach with ninja would require finding the vcvarsall.bat, which is not easily locatable.

Change-Id: Ia88194890d13f4abde6f0fc4b99f3e0da134bc4b
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/46340
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
2021-03-30 20:10:08 +00:00

140 lines
4.6 KiB
JSON

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
"version": "2.0.0",
"tasks": [
{
"label": "make",
"group": {
"kind": "build",
"isDefault": true
},
"type": "shell",
"osx": {
"command": "sh",
"args": [
"-c",
"cmake --build . && echo Done"
],
"options": {
"cwd": "${workspaceRoot}/build",
},
},
"linux": {
"command": "sh",
"args": [
"-c",
"cmake --build . && echo Done"
],
"options": {
"cwd": "${workspaceRoot}/build",
},
},
"windows": {
// Invokes ninja in the 'out/active' directory, which is created
// with the 'generate' task (see below).
"command": "cmd",
"args": [
"/C",
"ninja && echo Done"
],
"options": {
"cwd": "${workspaceRoot}/out/active",
},
},
"presentation": {
"echo": false,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": "absolute",
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
{
"label": "configure",
"type": "shell",
"osx": {
"command": "cmake",
"args": [
"..",
"-GNinja",
"-DCMAKE_BUILD_TYPE=${input:buildType}",
],
"options": {
"cwd": "${workspaceRoot}/build"
},
},
"linux": {
"command": "cmake",
"args": [
"..",
"-GNinja",
"-DCMAKE_BUILD_TYPE=${input:buildType}",
],
"options": {
"cwd": "${workspaceRoot}/build"
},
},
"windows": {
// Generates a GN build directory at 'out/<build-type>' with the
// is_debug argument set to to true iff the build-type is Debug.
// A symbolic link to this build directory is created at 'out/active'
// which is used to track the active build directory.
"command": "cmd",
"args": [
"/C",
"(IF \"${input:buildType}\" == \"Debug\" ( gn gen 'out\\${input:buildType}' --args=is_debug=true ) ELSE ( gn gen 'out\\${input:buildType}' --args=is_debug=false )) && (IF EXIST 'out\\active' rmdir 'out\\active' /q /s) && (mklink /j 'out\\active' 'out\\${input:buildType}')",
],
},
"problemMatcher": [],
},
{
"label": "Push branch for review",
"type": "shell",
"command": "git",
"args": [
"push",
"origin",
"HEAD:refs/for/main"
],
"options": {
"cwd": "${workspaceRoot}"
},
"problemMatcher": [],
}
],
"inputs": [
{
"id": "buildType",
"type": "pickString",
"options": [
"Debug",
"Release",
"MinSizeRel",
"RelWithDebInfo",
],
"default": "Debug",
"description": "The type of build",
},
]
}