generated from tonytins/godotstarter
Moved build.zig to root
- Ignore .zig-cache
This commit is contained in:
parent
60d28a2879
commit
99c122a138
2 changed files with 9 additions and 6 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -114,7 +114,7 @@ $RECYCLE.BIN/
|
|||
### zig ###
|
||||
# Zig programming language
|
||||
|
||||
zig-cache/
|
||||
.zig-cache/
|
||||
zig-out/
|
||||
build/
|
||||
build-*/
|
||||
|
|
|
@ -4,6 +4,9 @@ const std = @import("std");
|
|||
// declaratively construct a build graph that will be executed by an external
|
||||
// runner.
|
||||
pub fn build(b: *std.Build) void {
|
||||
const server = "server/src/main.zig";
|
||||
const tests = "server/src/root.zig";
|
||||
|
||||
// Standard target options allows the person running `zig build` to choose
|
||||
// what target to build for. Here we do not override the defaults, which
|
||||
// means any target is allowed, and the default is native. Other options
|
||||
|
@ -19,7 +22,7 @@ pub fn build(b: *std.Build) void {
|
|||
.name = "server",
|
||||
// In this case the main source file is merely a path, however, in more
|
||||
// complicated build scripts, this could be a generated file.
|
||||
.root_source_file = b.path("src/root.zig"),
|
||||
.root_source_file = b.path(tests),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
@ -31,7 +34,7 @@ pub fn build(b: *std.Build) void {
|
|||
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "server",
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.root_source_file = b.path(server),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
@ -67,7 +70,7 @@ pub fn build(b: *std.Build) void {
|
|||
// Creates a step for unit testing. This only builds the test executable
|
||||
// but does not run it.
|
||||
const lib_unit_tests = b.addTest(.{
|
||||
.root_source_file = b.path("src/root.zig"),
|
||||
.root_source_file = b.path(tests),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
@ -75,7 +78,7 @@ pub fn build(b: *std.Build) void {
|
|||
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
|
||||
|
||||
const exe_unit_tests = b.addTest(.{
|
||||
.root_source_file = b.path("src/main.zig"),
|
||||
.root_source_file = b.path(server),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
Loading…
Add table
Reference in a new issue