add main engine library + minimal glfw linking example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
68556c9318
commit
7fcd051870
2 changed files with 27 additions and 0 deletions
19
build.zig
Normal file
19
build.zig
Normal file
|
@ -0,0 +1,19 @@
|
|||
const Builder = @import("std").build.Builder;
|
||||
const glfw = @import("glfw/build.zig");
|
||||
|
||||
pub fn build(b: *Builder) void {
|
||||
const mode = b.standardReleaseOptions();
|
||||
const lib = b.addStaticLibrary("engine", "src/main.zig");
|
||||
lib.addPackagePath("glfw", "glfw/src/main.zig");
|
||||
lib.setBuildMode(mode);
|
||||
glfw.link(b, lib, .{});
|
||||
lib.install();
|
||||
|
||||
var main_tests = b.addTest("src/main.zig");
|
||||
main_tests.addPackagePath("glfw", "glfw/src/main.zig");
|
||||
glfw.link(b, main_tests, .{});
|
||||
main_tests.setBuildMode(mode);
|
||||
|
||||
const test_step = b.step("test", "Run library tests");
|
||||
test_step.dependOn(&main_tests.step);
|
||||
}
|
8
src/main.zig
Normal file
8
src/main.zig
Normal file
|
@ -0,0 +1,8 @@
|
|||
const std = @import("std");
|
||||
const testing = std.testing;
|
||||
|
||||
const glfw = @import("glfw");
|
||||
|
||||
test "glfw_basic" {
|
||||
glfw.basicTest();
|
||||
}
|
Loading…
Add table
Reference in a new issue