const std = @import("std"); pub fn build(b: *std.Build) void { const exe = b.addExecutable(.{ .name = "find-pgcd", .root_source_file = .{ .path = "main.zig" }, }); exe.addIncludePath(.{ .path = "." }); b.installArtifact(exe); const lib = b.addStaticLibrary(.{ .name = "pgcd", .root_source_file = .{ .path = "pgcd.c" }, .target = .{}, .optimize = std.builtin.OptimizeMode.Debug, }); exe.linkLibrary(lib); // We could also have used exe.addCSourceFile("pgcd.c", &[_][]const u8 {}); (untested), see https://zig.news/xq/zig-build-explained-part-2-1850 }