|
|
@ -1,6 +1,5 @@ |
|
|
|
const std = @import("std"); |
|
|
|
const std = @import("std"); |
|
|
|
const mach = @import("mach"); |
|
|
|
const mach = @import("mach"); |
|
|
|
const zmath = @import("zmath"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn build(b: *std.Build) !void { |
|
|
|
pub fn build(b: *std.Build) !void { |
|
|
|
const target = b.standardTargetOptions(.{}); |
|
|
|
const target = b.standardTargetOptions(.{}); |
|
|
@ -12,9 +11,10 @@ pub fn build(b: *std.Build) !void { |
|
|
|
// Only using mach.core, avoid pulling unnecessary dependencies. |
|
|
|
// Only using mach.core, avoid pulling unnecessary dependencies. |
|
|
|
.core = true, |
|
|
|
.core = true, |
|
|
|
}); |
|
|
|
}); |
|
|
|
const zigimg_dep = b.dependency("zigimg", .{ .target = target, .optimize = optimize }); |
|
|
|
|
|
|
|
const zmath_pkg = zmath.package(b, target, optimize, .{}); |
|
|
|
const zmath = b.dependency("zmath", .{ .target = target, .optimize = optimize }); |
|
|
|
const flecszigble_dep = b.dependency("flecs-zig-ble", .{ .target = target, .optimize = optimize }); |
|
|
|
const zigimg = b.dependency("zigimg", .{ .target = target, .optimize = optimize }); |
|
|
|
|
|
|
|
const flecszigble = b.dependency("flecs-zig-ble", .{ .target = target, .optimize = optimize }); |
|
|
|
|
|
|
|
|
|
|
|
const app = try mach.CoreApp.init(b, mach_dep.builder, .{ |
|
|
|
const app = try mach.CoreApp.init(b, mach_dep.builder, .{ |
|
|
|
.name = "zig-bloxel-game", |
|
|
|
.name = "zig-bloxel-game", |
|
|
@ -22,12 +22,14 @@ pub fn build(b: *std.Build) !void { |
|
|
|
.target = target, |
|
|
|
.target = target, |
|
|
|
.optimize = optimize, |
|
|
|
.optimize = optimize, |
|
|
|
.deps = &.{ |
|
|
|
.deps = &.{ |
|
|
|
.{ .name = "zigimg", .module = zigimg_dep.module("zigimg") }, |
|
|
|
.{ .name = "zmath", .module = zmath.module("root") }, |
|
|
|
.{ .name = "zmath", .module = zmath_pkg.zmath }, |
|
|
|
.{ .name = "zigimg", .module = zigimg.module("zigimg") }, |
|
|
|
.{ .name = "flecs-zig-ble", .module = flecszigble_dep.module("flecs-zig-ble") }, |
|
|
|
.{ .name = "flecs-zig-ble", .module = flecszigble.module("flecs-zig-ble") }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
app.compile.linkLibrary(flecszigble_dep.artifact("flecs-zig-ble")); |
|
|
|
// Honestly, not sure how this works, but this seems |
|
|
|
|
|
|
|
// to be required for Flecs' header file to be found? |
|
|
|
|
|
|
|
app.compile.linkLibrary(flecszigble.artifact("flecs-zig-ble")); |
|
|
|
if (b.args) |args| app.run.addArgs(args); |
|
|
|
if (b.args) |args| app.run.addArgs(args); |
|
|
|
|
|
|
|
|
|
|
|
const run_step = b.step("run", "Run the app"); |
|
|
|
const run_step = b.step("run", "Run the app"); |
|
|
@ -38,7 +40,6 @@ pub fn build(b: *std.Build) !void { |
|
|
|
.target = target, |
|
|
|
.target = target, |
|
|
|
.optimize = optimize, |
|
|
|
.optimize = optimize, |
|
|
|
}); |
|
|
|
}); |
|
|
|
unit_tests.root_module.addImport("zmath", zmath_pkg.zmath); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const run_unit_tests = b.addRunArtifact(unit_tests); |
|
|
|
const run_unit_tests = b.addRunArtifact(unit_tests); |
|
|
|
const test_step = b.step("test", "Run unit tests"); |
|
|
|
const test_step = b.step("test", "Run unit tests"); |
|
|
|