Skip to content

Commit

Permalink
build: add option to build a PIE executable
Browse files Browse the repository at this point in the history
  • Loading branch information
tranzystorekk committed Sep 27, 2024
1 parent e26f6e1 commit 0ad2c72
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});

const pie = b.option(bool, "pie", "Build a Position Independent Executable");

// Expose zf as a Zig module
const zf_module = b.addModule("zf", .{
.root_source_file = b.path("src/zf/zf.zig"),
Expand All @@ -23,6 +25,7 @@ pub fn build(b: *std.Build) void {

tui.root_module.addImport("zf", zf_module);
tui.root_module.addImport("vaxis", dep_vaxis.module("vaxis"));
tui.pie = pie;

b.installArtifact(tui);

Expand Down

0 comments on commit 0ad2c72

Please sign in to comment.