this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

deps: add `external_uucode` option to use externally provided uucode

authored by

Jacob Sandlund and committed by
Tim Culverhouse
7655966a 4e5a0659

+27 -15
+26 -15
build.zig
··· 4 4 const target = b.standardTargetOptions(.{}); 5 5 const optimize = b.standardOptimizeOption(.{}); 6 6 const use_llvm = b.option(bool, "llvm", "Use the LLVM backend for compile steps") orelse true; 7 + const external_uucode = b.option(bool, "external_uucode", "Use an externally provided uucode module instead of the built-in dependency") orelse false; 7 8 const root_source_file = b.path("src/main.zig"); 8 9 9 10 // Dependencies ··· 11 12 .optimize = optimize, 12 13 .target = target, 13 14 }); 14 - const uucode_dep = b.dependency("uucode", .{ 15 - .target = target, 16 - .optimize = optimize, 17 - .fields = @as([]const []const u8, &.{ 18 - "east_asian_width", 19 - "grapheme_break", 20 - "general_category", 21 - "is_emoji_presentation", 22 - }), 23 - }); 15 + const uucode_mod = if (!external_uucode) blk: { 16 + const uucode_dep = b.lazyDependency("uucode", .{ 17 + .target = target, 18 + .optimize = optimize, 19 + .fields = @as([]const []const u8, &.{ 20 + "east_asian_width", 21 + "grapheme_break", 22 + "general_category", 23 + "is_emoji_presentation", 24 + }), 25 + }) orelse break :blk null; 26 + break :blk uucode_dep.module("uucode"); 27 + } else null; 24 28 25 29 // Module 26 30 const vaxis_mod = b.addModule("vaxis", .{ ··· 29 33 .optimize = optimize, 30 34 }); 31 35 vaxis_mod.addImport("zigimg", zigimg_dep.module("zigimg")); 32 - vaxis_mod.addImport("uucode", uucode_dep.module("uucode")); 36 + if (uucode_mod) |mod| { 37 + vaxis_mod.addImport("uucode", mod); 38 + } 33 39 34 40 // Examples 35 41 const Example = enum { ··· 107 113 .root_source_file = b.path("src/main.zig"), 108 114 .target = target, 109 115 .optimize = optimize, 110 - .imports = &.{ 111 - .{ .name = "zigimg", .module = zigimg_dep.module("zigimg") }, 112 - .{ .name = "uucode", .module = uucode_dep.module("uucode") }, 113 - }, 116 + .imports = if (uucode_mod) |mod| 117 + &.{ 118 + .{ .name = "zigimg", .module = zigimg_dep.module("zigimg") }, 119 + .{ .name = "uucode", .module = mod }, 120 + } 121 + else 122 + &.{ 123 + .{ .name = "zigimg", .module = zigimg_dep.module("zigimg") }, 124 + }, 114 125 }), 115 126 }); 116 127
+1
build.zig.zon
··· 11 11 .uucode = .{ 12 12 .url = "git+https://github.com/jacobsandlund/uucode#2826a37a4562284fdacd8fa029d49509cc9bffcd", 13 13 .hash = "uucode-0.2.0-ZZjBPlK5VADj7fdoq7G8LIHzD5o6FSkcBXXrRWr4jnrA", 14 + .lazy = true, 14 15 }, 15 16 }, 16 17 .paths = .{