From 3cb6428da6bc934bc78f5a4e543083dc287be760 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 22 May 2022 15:25:38 +0200 Subject: [PATCH] build: add -Dstrip and -Dpie build options --- build.zig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.zig b/build.zig index 5de182b..4d0017c 100644 --- a/build.zig +++ b/build.zig @@ -16,6 +16,9 @@ pub fn build(b: *zbs.Builder) !void { const target = b.standardTargetOptions(.{}); const mode = b.standardReleaseOptions(); + const strip = b.option(bool, "strip", "Omit debug information") orelse false; + const pie = b.option(bool, "pie", "Build a Position Independent Executable") orelse false; + const man_pages = b.option( bool, "man-pages", @@ -123,6 +126,8 @@ pub fn build(b: *zbs.Builder) !void { addServerDeps(river, scanner); + river.strip = strip; + river.pie = pie; river.install(); } @@ -143,6 +148,8 @@ pub fn build(b: *zbs.Builder) !void { scanner.addCSource(riverctl); + riverctl.strip = strip; + riverctl.pie = pie; riverctl.install(); } @@ -163,6 +170,8 @@ pub fn build(b: *zbs.Builder) !void { scanner.addCSource(rivertile); + rivertile.strip = strip; + rivertile.pie = pie; rivertile.install(); }