Skip to content

Instantly share code, notes, and snippets.

@hcarty
Last active October 22, 2021 04:11
Show Gist options
  • Save hcarty/7e0390a97ca17ed22c7e3136faccbdf5 to your computer and use it in GitHub Desktop.
Save hcarty/7e0390a97ca17ed22c7e3136faccbdf5 to your computer and use it in GitHub Desktop.
VS Code tasks.json for a C or C++ orx project built with (g)make

Basic task definitions for building orx games with gmake for C or C++

Take either of these files and save as .vscode/tasks.json in your orx project.

Based on the vscode reference material here: https://code.visualstudio.com/docs/editor/tasks

{
"version": "2.0.0",
"tasks": [
{
"label": "Setup orx",
"group": "build",
"type": "shell",
"command": "./setup.sh",
"options": {
"cwd": "${workspaceFolder}"
},
"windows": {
"command": ".\\setup.bat",
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
}
},
{
"label": "Build orx (debug)",
"group": {
"kind": "build",
"isDefault": true
},
"type": "shell",
"linux": {
"command": "make",
"options": {
"cwd": "code/build/linux/gmake/"
}
},
"osx": {
"command": "make",
"options": {
"cwd": "code/build/mac/gmake/"
}
},
"windows": {
"command": "mingw32-make.exe",
"options": {
"cwd": "code/build/windows/gmake/",
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"problemMatcher": [
"$gcc"
]
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "Build game",
"group": {
"kind": "build",
"isDefault": true
},
"type": "shell",
"linux": {
"command": "make",
"options": {
"cwd": "build/linux/gmake/"
}
},
"osx": {
"command": "make",
"options": {
"cwd": "build/mac/gmake/"
}
},
"windows": {
"command": "mingw32-make.exe",
"options": {
"cwd": "build/windows/gmake/",
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"problemMatcher": [
"$gcc"
]
},
{
"label": "Run game",
"type": "shell",
"osx": {
"command": "./bin/vscode-experimentd"
},
"linux": {
"command": "./bin/vscode-experimentd"
},
"windows": {
"command": ".\\bin\\vscode-experimentd.exe"
},
"dependsOn": [
"Build game"
],
"problemMatcher": [
"$gcc"
]
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "Build game",
"group": {
"kind": "build",
"isDefault": true
},
"type": "shell",
"linux": {
"command": "make",
"options": {
"cwd": "build/linux/gmake/"
}
},
"osx": {
"command": "make",
"options": {
"cwd": "build/mac/gmake/"
}
},
"windows": {
"command": "mingw32-make.exe",
"options": {
"cwd": "build/windows/gmake/",
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c"
]
}
}
},
"problemMatcher": [
"$gcc"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment