Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Enable PIC
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn committed May 3, 2024
1 parent 9c72163 commit fe9870f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
.version = version,
.root_source_file = .{ .path = "src/lib.zig" },
.pic = true,
});
_ = lib.getEmittedH(); // Needed to trigger header generation
lib.bundle_compiler_rt = true;
lib.pie = true;
const lib_install = b.addInstallArtifact(lib, .{});
// Ideally we would use dlib.getEmittedH(), but https://github.com/ziglang/zig/issues/18497
const lib_header = b.addInstallFile(.{ .path = "zig-cache/fastlanez.h" }, "include/fastlanez.h");
Expand All @@ -56,6 +56,7 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
.version = version,
.root_source_file = .{ .path = "src/lib.zig" },
.pic = true,
});
_ = lib.getEmittedH(); // Needed to trigger header generation
dylib.bundle_compiler_rt = true;
Expand Down

0 comments on commit fe9870f

Please sign in to comment.