From 7fe58b82f5981b2e1f3b74265ce4cffcd6678b13 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 30 Jul 2022 16:03:12 +0200 Subject: [PATCH] add a minimal build file to compile st with zig this ignores config.h, tic -sx st.info and man page gen for now. --- build.zig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 build.zig diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..7446c7a --- /dev/null +++ b/build.zig @@ -0,0 +1,26 @@ +const std = @import("std"); + +pub fn build(b: *std.build.Builder) void { + const target = b.standardTargetOptions(.{}); + const mode = b.standardReleaseOptions(); + + const exe = b.addExecutable("st", null); + exe.setTarget(target); + exe.setBuildMode(mode); + exe.install(); + 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.4.1\"", + "-D_XOPEN_SOURCE=600", + "-Wall", + "-Werror", + }); +}