You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.0 KiB
Zig

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",
});
}