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 26, 2024
1 parent a3e7b62 commit 0f0666a
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
_ = b.addModule("zf", .{
.root_source_file = b.path("src/lib.zig"),
Expand All @@ -22,6 +24,7 @@ pub fn build(b: *std.Build) void {
});

exe.root_module.addImport("vaxis", dep_vaxis.module("vaxis"));
exe.pie = pie;

b.installArtifact(exe);

Expand Down

0 comments on commit 0f0666a

Please sign in to comment.