VS Code Sample Configs - noodlecollie/afterburner-game GitHub Wiki

The following snippets are some sample configurations for building/running the game using Visual Studio Code.

Linux

tasks.json

"tasks":
[
    {
        "label": "Configure (Debug)",
        "type": "shell",
        "command": "python3",
        "args":
        [
            "waf",
            "configure",
            "--disable-vgui",
            "--win-style-install",
            "--build-type=debug",
            "--prefix=build/debug"
        ]
    },
    {
        "label": "Configure (Release)",
        "type": "shell",
        "command": "python3",
        "args":
        [
            "waf",
            "configure",
            "--disable-vgui",
            "--win-style-install",
            "--build-type=release",
            "--prefix=build/release"
        ]
    },
    {
        "label": "Configure Dedicated Server (Release)",
        "type": "shell",
        "command": "python3",
        "args":
        [
            "waf",
            "configure",
            "--dedicated",
            "--disable-vgui",
            "--win-style-install",
            "--build-type=release",
            "--prefix=build/release"
        ]
    },
    {
        "label": "Configure + Utils (Debug)",
        "type": "shell",
        "command": "python3",
        "args":
        [
            "waf",
            "configure",
            "--disable-vgui",
            "--win-style-install",
            "--build-type=debug",
            "--prefix=build/debug",
            "--enable-utils"
        ]
    },
    {
        "label": "Clean Build and Install",
        "type": "shell",
        "command": "python3",
        "args":
        [
            "waf",
            "clean",
            "build",
            "install"
        ],
        "problemMatcher":
        {
            "owner": "cpp",
            "fileLocation":
            [
                "relative",
                "${workspaceFolder}/build"
            ],
            "pattern":
            {
                "regexp": "^(\\.\\./.*):(\\d+):(\\d+):\\s+(warning|error|fatal error):\\s+(.*)$",
                "file": 1,
                "line": 2,
                "column": 3,
                "severity": 4,
                "message": 5
            }
        }
    },
    {
        "label": "Incremental Build and Install",
        "type": "shell",
        "command": "python3",
        "args":
        [
            "waf",
            "build",
            "install"
        ],
        "problemMatcher":
        {
            "owner": "cpp",
            "fileLocation":
            [
                "relative",
                "${workspaceFolder}/build"
            ],
            "pattern":
            {
                "regexp": "^(\\.\\./.*):(\\d+):(\\d+):\\s+(warning|error|fatal error):\\s+(.*)$",
                "file": 1,
                "line": 2,
                "column": 3,
                "severity": 4,
                "message": 5
            }
        }
    }
]

launch.json (CppDbg)

"configurations":
[
    {
        "name": "Launch Afterburner",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}/build/debug/bond",
        "args":
        [
            "-dev", "5",
            "-toconsole",
            "-windowed",
            "-width", "1920",
            "-height", "1080"
        ],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}/build/debug",
        "environment":
        [
            { "name": "LD_LIBRARY_PATH", "value": "${workspaceFolder}/build/debug" }
        ],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            }
        ]
    }
]

launch.json (GDB with NativeDebug extension)

"configurations":
[
    {
        "name": "Launch Afterburner",
        "type": "gdb",
        "request": "launch",
        "target": "${workspaceFolder}/build/debug/bond",
        "arguments": "-dev 5 -toconsole -windowed -width 1920 -height 1080",
        "cwd": "${workspaceFolder}/build/debug",
        "valuesFormatting": "parseText",
        "env":
        {
            "LD_LIBRARY_PATH": "${workspaceFolder}/build/debug"
        }
    }
]

Windows

tasks.json

"tasks":
[
    {
        "label": "Configure (Debug)",
        "type": "shell",
        "command": "python",
        "args":
        [
            "waf",
            "configure",
            "--disable-vgui",
            "--win-style-install",
            "--build-type=debug",
            "--prefix=build/debug",
            "--sdl2=\"..\\..\\SDL2-2.0.12\""
        ]
    },
    {
        "label": "Configure (Release)",
        "type": "shell",
        "command": "python",
        "args":
        [
            "waf",
            "configure",
            "--disable-vgui",
            "--win-style-install",
            "--build-type=release",
            "--prefix=build/release",
            "--sdl2=\"..\\..\\SDL2-2.0.12\""
        ]
    },
    {
        "label": "Configure Dedicated Server (Release)",
        "type": "shell",
        "command": "python",
        "args":
        [
            "waf",
            "configure",
            "--dedicated",
            "--disable-vgui",
            "--win-style-install",
            "--build-type=release",
            "--prefix=build/release",
            "--sdl2=\"..\\..\\SDL2-2.0.12\""
        ]
    },
    {
        "label": "Configure + Utils (Debug)",
        "type": "shell",
        "command": "python",
        "args":
        [
            "waf",
            "configure",
            "--disable-vgui",
            "--win-style-install",
            "--build-type=debug",
            "--prefix=build/debug",
            "--sdl2=\"..\\..\\SDL2-2.0.12\"",
            "--enable-utils"
        ]
    },
    {
        "label": "Clean Build and Install",
        "type": "shell",
        "command": "python",
        "args":
        [
            "waf",
            "clean",
            "build",
            "install"
        ],
        "problemMatcher":
        {
            "owner": "cpp",
            "fileLocation": "absolute",
            "pattern":
            {
                "regexp": "^(.+)\\((\\d+)\\):\\s+(warning|error)\\s+C\\d+:\\s+(.*)$",
                "file": 1,
                "line": 2,
                "severity": 3,
                "message": 4
            }
        },
    },
    {
        "label": "Incremental Build and Install",
        "type": "shell",
        "command": "python",
        "args":
        [
            "waf",
            "build",
            "install"
        ],
        "problemMatcher":
        {
            "owner": "cpp",
            "fileLocation": "absolute",
            "pattern":
            {
                "regexp": "^(.+)\\((\\d+)\\):\\s+(warning|error)\\s+C\\d+:\\s+(.*)$",
                "file": 1,
                "line": 2,
                "severity": 3,
                "message": 4
            }
        },
        "group":
        {
            "kind": "build",
            "isDefault": true
        }
    }
]