zip-zig

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

build.zig (834B)


      1 const std = @import("std");
      2 
      3 pub fn build(b: *std.Build) void {
      4     const target = b.standardTargetOptions(.{});
      5     const optimize = b.standardOptimizeOption(.{});
      6 
      7     const lib = b.addStaticLibrary(.{
      8         .name = "zip-zig",
      9         .root_source_file = .{ .path = "src/main.zig" },
     10         .target = target,
     11         .optimize = optimize,
     12     });
     13 
     14     b.installArtifact(lib);
     15     // For zig package manager, module must be named
     16     _ = b.addModule("zip", .{ .source_file = .{ .path = "src/main.zig" } });
     17 
     18     const main_tests = b.addTest(.{
     19         .root_source_file = .{ .path = "src/main.zig" },
     20         .target = target,
     21         .optimize = optimize,
     22     });
     23 
     24     const run_main_tests = b.addRunArtifact(main_tests);
     25     const test_step = b.step("test", "Run library tests");
     26     test_step.dependOn(&run_main_tests.step);
     27 }