.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>
This commit is contained in:
Ben Clayton 2021-03-30 20:10:08 +00:00 committed by Commit Bot service account
parent 59b28c4cbc
commit 96a57f65dd
1 changed files with 53 additions and 19 deletions

72
.vscode/tasks.json vendored
View File

@ -17,27 +17,37 @@
"isDefault": true
},
"type": "shell",
"command": "sh",
"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",
"cmake --build . && echo Done"
]
},
"options": {
"cwd": "${workspaceRoot}/build",
"/C",
"ninja && echo Done"
],
"options": {
"cwd": "${workspaceRoot}/out/active",
},
},
"presentation": {
"echo": false,
@ -61,16 +71,40 @@
}
},
{
"label": "cmake",
"label": "configure",
"type": "shell",
"command": "cmake",
"args": [
"..",
"-GNinja",
"-DCMAKE_BUILD_TYPE=${input:buildType}",
],
"options": {
"cwd": "${workspaceRoot}/build"
"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": [],
},
@ -103,4 +137,4 @@
"description": "The type of build",
},
]
}
}