Tidy up build configurations

This commit is contained in:
kayomn 2022-10-30 22:06:56 +00:00
parent 14397b05e3
commit 35de8cf2ae
3 changed files with 10 additions and 18 deletions

2
.vscode/launch.json vendored
View File

@ -19,7 +19,7 @@
"arguments": "main.zig",
"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText",
"preLaunchTask": "Build Tests",
"preLaunchTask": "Build Debug",
},
]
}

9
.vscode/tasks.json vendored
View File

@ -28,7 +28,7 @@
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"reveal": "silent",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
@ -36,12 +36,5 @@
"revealProblems": "onProblem",
},
},
{
"label": "Build Tests",
"type": "shell",
"command": "zig build test",
"group": "build",
},
],
}

View File

@ -10,15 +10,15 @@ pub fn build(builder: *std.build.Builder) void {
// Ona executable.
{
const exe = builder.addExecutable("ona", "./src/ona/main.zig");
const ona = builder.addExecutable("ona", "./src/ona/main.zig");
exe.addPackage(core_pkg);
exe.setTarget(target);
exe.setBuildMode(mode);
exe.install();
exe.addIncludeDir("./ext");
exe.linkSystemLibrary("SDL2");
exe.linkLibC();
ona.addPackage(core_pkg);
ona.setTarget(target);
ona.setBuildMode(mode);
ona.install();
ona.addIncludeDir("./ext");
ona.linkSystemLibrary("SDL2");
ona.linkLibC();
}
// Tests executable.
@ -29,7 +29,6 @@ pub fn build(builder: *std.build.Builder) void {
tests.setTarget(target);
tests.setBuildMode(mode);
tests.install();
builder.step("test", "Run unit tests").dependOn(&tests.step);
}
}