const std = @import("std"); pub fn build(b: *std.build.Builder) void { const target = b.standardTargetOptions(.{}); const mode = b.standardReleaseOptions(); const do_strip = b.option(bool, "strip", "Strip final output; on for release-small") orelse switch (mode) { .ReleaseSmall => true, else => false, }; const libsegfault = b.addStaticLibrary("segfault", "src/segfault.zig"); libsegfault.setTarget(target); libsegfault.setBuildMode(mode); libsegfault.force_pic = true; const exe = b.addExecutable("st", null); exe.setTarget(target); exe.setBuildMode(mode); exe.strip = do_strip; exe.install(); exe.linkLibrary(libsegfault); exe.linkSystemLibrary("fontconfig"); exe.linkSystemLibrary("freetype2"); exe.linkSystemLibrary("Xft"); exe.linkSystemLibrary("X11"); exe.linkLibC(); exe.pie = true; exe.addCSourceFiles(&.{ "st.c", "x.c", }, &.{ "-DVERSION=\"0.8.5.1\"", "-D_XOPEN_SOURCE=600", "-Wall", "-Werror", }); }