| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | const std = @import("std"); |
| 2 | const builtin = @import("builtin"); |
| 3 | const Builder = std.build.Builder; |
| 4 | |
| 5 | pub fn build(b: *Builder) void { |
| 6 | const mode = b.standardReleaseOptions(); |
| 7 | |
| 8 | const test_step = b.step("test", "Test"); |
| 9 | test_step.dependOn(b.getInstallStep()); |
| 10 | |
| 11 | const lib = b.addSharedLibrary("lib", "lib.zig", .unversioned); |
| 12 | lib.setBuildMode(mode); |
| 13 | lib.setTarget(.{ .cpu_arch = .wasm32, .os_tag = .freestanding }); |
| 14 | lib.use_llvm = false; |
| 15 | lib.use_stage1 = false; |
| 16 | lib.use_lld = false; |
| 17 | lib.install(); |
| 18 | |
| 19 | const zig_version = builtin.zig_version; |
| 20 | var version_buf: [100]u8 = undefined; |
| 21 | const version_fmt = std.fmt.bufPrint(&version_buf, "version {}", .{zig_version}) catch unreachable; |
| 22 | |
| 23 | const check_lib = lib.checkObject(.wasm); |
| 24 | check_lib.checkStart("name producers"); |
| 25 | check_lib.checkNext("fields 2"); |
| 26 | check_lib.checkNext("field_name language"); |
| 27 | check_lib.checkNext("values 1"); |
| 28 | check_lib.checkNext("value_name Zig"); |
| 29 | check_lib.checkNext(version_fmt); |
| 30 | check_lib.checkNext("field_name processed-by"); |
| 31 | check_lib.checkNext("values 1"); |
| 32 | check_lib.checkNext("value_name Zig"); |
| 33 | check_lib.checkNext(version_fmt); |
| 34 | |
| 35 | test_step.dependOn(&check_lib.step); |
| 36 | } |