56 lines
1.6 KiB
Zig
56 lines
1.6 KiB
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
const raylib_dep = b.dependency("raylib_zig", .{
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.linux_display_backend = .Wayland,
|
|
});
|
|
|
|
const raylib = raylib_dep.module("raylib");
|
|
const raygui = raylib_dep.module("raygui");
|
|
const raylib_artifact = raylib_dep.artifact("raylib"); // raylib C library
|
|
|
|
const mod = b.addModule("sand", .{
|
|
.root_source_file = b.path("src/root.zig"),
|
|
.target = target,
|
|
});
|
|
|
|
const exe = b.addExecutable(.{
|
|
.name = "sand",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("src/main.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "sand", .module = mod },
|
|
.{ .name = "raylib", .module = raylib },
|
|
.{ .name = "raygui", .module = raygui },
|
|
},
|
|
}),
|
|
.use_lld = false,
|
|
});
|
|
exe.root_module.linkLibrary(raylib_artifact);
|
|
|
|
b.installArtifact(exe);
|
|
|
|
const mod_tests = b.addTest(.{
|
|
.root_module = mod,
|
|
});
|
|
|
|
const run_mod_tests = b.addRunArtifact(mod_tests);
|
|
|
|
const test_step = b.step("test", "Run tests");
|
|
test_step.dependOn(&run_mod_tests.step);
|
|
|
|
const exe_check = b.addExecutable(.{
|
|
.name = "sand",
|
|
.root_module = exe.root_module,
|
|
});
|
|
|
|
const check = b.step("check", "Check if foo compiles");
|
|
check.dependOn(&exe_check.step);
|
|
}
|