| author | |
| committer | |
| log | d9cd4d087648c6d83e22dda6a4b82929a72fc771 |
| tree | 7de721fb8c545024d42797f7f0f891035cb300f5 |
| parent | f6c1864abf4dc6a94789bb6137de5d5c2dd921cd |
| signature |
This functionality is already load-bearing for the compiler's own build script
so this (disabled, possibly bitrotted?) doesn't really add value.3 files changed, 0 insertions(+), 37 deletions(-)
test/standalone/build.zig.zon-4| ... | @@ -143,10 +143,6 @@ | ... | @@ -143,10 +143,6 @@ |
| 143 | //.sigpipe = .{ | 143 | //.sigpipe = .{ |
| 144 | // .path = "sigpipe", | 144 | // .path = "sigpipe", |
| 145 | //}, | 145 | //}, |
| 146 | // TODO restore this test | ||
| 147 | //.options = .{ | ||
| 148 | // .path = "options", | ||
| 149 | //}, | ||
| 150 | .strip_empty_loop = .{ | 146 | .strip_empty_loop = .{ |
| 151 | .path = "strip_empty_loop", | 147 | .path = "strip_empty_loop", |
| 152 | }, | 148 | }, |
test/standalone/options/build.zig deleted-21| ... | @@ -1,21 +0,0 @@ | ||
| 1 | const std = @import("std"); | ||
| 2 | |||
| 3 | pub fn build(b: *std.Build) void { | ||
| 4 | const main = b.addTest(.{ .root_module = b.createModule(.{ | ||
| 5 | .root_source_file = b.path("src/main.zig"), | ||
| 6 | .target = b.graph.host, | ||
| 7 | .optimize = .Debug, | ||
| 8 | }) }); | ||
| 9 | |||
| 10 | const options = b.addOptions(); | ||
| 11 | main.root_module.addOptions("build_options", options); | ||
| 12 | options.addOption(bool, "bool_true", b.option(bool, "bool_true", "t").?); | ||
| 13 | options.addOption(bool, "bool_false", b.option(bool, "bool_false", "f").?); | ||
| 14 | options.addOption(u32, "int", b.option(u32, "int", "i").?); | ||
| 15 | const E = enum { one, two, three }; | ||
| 16 | options.addOption(E, "e", b.option(E, "e", "e").?); | ||
| 17 | options.addOption([]const u8, "string", b.option([]const u8, "string", "s").?); | ||
| 18 | |||
| 19 | const test_step = b.step("test", "Run unit tests"); | ||
| 20 | test_step.dependOn(&b.addRunArtifact(main).step); | ||
| 21 | } | ||
test/standalone/options/src/main.zig deleted-12| ... | @@ -1,12 +0,0 @@ | ||
| 1 | const std = @import("std"); | ||
| 2 | const assert = std.debug.assert; | ||
| 3 | |||
| 4 | const build_options = @import("build_options"); | ||
| 5 | |||
| 6 | test "build options" { | ||
| 7 | comptime assert(build_options.bool_true); | ||
| 8 | comptime assert(!build_options.bool_false); | ||
| 9 | comptime assert(build_options.int == 1234); | ||
| 10 | comptime assert(build_options.e == .two); | ||
| 11 | comptime assert(std.mem.eql(u8, build_options.string, "hello")); | ||
| 12 | } | ||