From f7e2c263ba5279f16eb6e9c5c29cad910c391402 Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 31 May 2020 21:48:47 -0700 Subject: [PATCH] debugging and vscode stuffs --- zig-ecs/.vscode/launch.json | 13 +++++++ zig-ecs/.vscode/tasks.json | 72 +++++++++++++++++++++++++++++++++++++ zig-ecs/build.zig | 2 ++ 3 files changed, 87 insertions(+) create mode 100644 zig-ecs/.vscode/launch.json create mode 100644 zig-ecs/.vscode/tasks.json diff --git a/zig-ecs/.vscode/launch.json b/zig-ecs/.vscode/launch.json new file mode 100644 index 0000000..0251a3b --- /dev/null +++ b/zig-ecs/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "lldb Debug ecs binary", + "type": "lldb", + "request": "launch", + "program": "${workspaceFolder}/zig-cache/bin/ecs", + "args": [], + "preLaunchTask": "Build Project", + } + ] +} \ No newline at end of file diff --git a/zig-ecs/.vscode/tasks.json b/zig-ecs/.vscode/tasks.json new file mode 100644 index 0000000..425f970 --- /dev/null +++ b/zig-ecs/.vscode/tasks.json @@ -0,0 +1,72 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Build Project", + "type": "shell", + "command": "zig build", + "problemMatcher": [ + "$gcc" + ], + }, + { + "label": "Build and Run Project", + "type": "shell", + "command": "zig build run", + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Test Project", + "type": "shell", + "command": "zig build test", + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "clear": true + } + }, + { + "label": "Build and Run Current File", + "type": "shell", + "command": "zig run ${file}", + "problemMatcher": [ + "$gcc" + ], + "presentation": { + "clear": true + }, + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Build and Run Tests in Current File", + "type": "shell", + "command": "zig test ${file}", + "problemMatcher": [ + "$gcc" + ], + "presentation": { + "clear": true + }, + "group": { + "kind": "build", + "isDefault": true + } + }, + ] +} \ No newline at end of file diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index d182520..679ac1c 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -23,6 +23,8 @@ pub fn build(b: *Builder) void { // first element in the list is added as "run" so "zig build run" works if (i == 0) { + exe.name = "ecs"; + exe.setOutputDir("zig-cache/bin"); const run_exe_step = b.step("run", b.fmt("run {}.zig", .{name})); run_exe_step.dependOn(&run_cmd.step); }