summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/addons.zig12
-rw-r--r--build/core.zig2
2 files changed, 10 insertions, 4 deletions
diff --git a/build/addons.zig b/build/addons.zig
index a3a23825..b092b82a 100644
--- a/build/addons.zig
+++ b/build/addons.zig
@@ -2,12 +2,18 @@ const std = @import("std");
const mupdf_build = @import("mupdf.zig");
/// The GPU addons over sketchbook's `gpu_scene`: the snake (addons/snake_shader)
-/// and the frame corpus's translucent veil (test/veil.zig).
-pub fn gpu(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.lang.Optimize, addon_mod: *std.Build.Module) ?*std.Build.Step.Compile {
+/// and the frame corpus's translucent veil (test/veil.zig). They are the
+/// window build's, as sketchbook is: the terminal's configures without
+/// sketchbook beside the checkout, and there their steps say so.
+pub fn gpu(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.lang.Optimize, addon_mod: *std.Build.Module, window: bool) ?*std.Build.Step.Compile {
const snake_shader_step = b.step("snake-shader", "build the optional GPU snake addon into zig-out/lib");
var snake_shader_lib: ?*std.Build.Step.Compile = null;
const veil_step = b.step("veil", "build the frame corpus's translucent GPU test addon (test/veil.zig) into zig-out/lib");
- if (b.lazyDependency("sketchbook", .{ .@"gpu-only" = true })) |sb| {
+ if (!window) {
+ const fail = b.addFail("the GPU addons are the window's: -Dplatform=gui (sketchbook beside this checkout)");
+ snake_shader_step.dependOn(&fail.step);
+ veil_step.dependOn(&fail.step);
+ } else if (b.lazyDependency("sketchbook", .{ .@"gpu-only" = true })) |sb| {
const files = b.addWriteFiles();
for ([_][]const u8{ "vert", "frag", "post.frag" }) |stage| {
const compile = b.addSystemCommand(&.{ "glslc", "-O" });
diff --git a/build/core.zig b/build/core.zig
index 6656481a..2a434ba9 100644
--- a/build/core.zig
+++ b/build/core.zig
@@ -462,7 +462,7 @@ pub fn assemble(b: *std.Build, c: struct {
const kind_mod = b.addTranslateC(.{ .root_source_file = b.path("src/kinds/pardes_addon.h"), .target = target, .optimize = optimize }).createModule();
// ...and what an addon in Zig imports over it (src/kinds/addon.zig).
const addon_mod = b.createModule(.{ .root_source_file = b.path("src/kinds/addon.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "pardes_addon", .module = kind_mod }} });
- const snake_shader_lib = addons.gpu(b, target, optimize, addon_mod);
+ const snake_shader_lib = addons.gpu(b, target, optimize, addon_mod, c.also_gui or c.platform == .gui);
const pdf_built = addons.pdf(b, .{
.addon_mod = addon_mod,
.c_optimize = c_optimize,