mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Merge pull request #2647 from ghostty-org/push-vsytqoyrvsvv
build.zig: add -Dpie option for position independent executables
This commit is contained in:
@ -98,6 +98,12 @@ pub fn build(b: *std.Build) !void {
|
|||||||
"Enables the use of Adwaita when using the GTK rendering backend.",
|
"Enables the use of Adwaita when using the GTK rendering backend.",
|
||||||
) orelse true;
|
) orelse true;
|
||||||
|
|
||||||
|
const pie = b.option(
|
||||||
|
bool,
|
||||||
|
"pie",
|
||||||
|
"Build a Position Independent Executable",
|
||||||
|
) orelse false;
|
||||||
|
|
||||||
const conformance = b.option(
|
const conformance = b.option(
|
||||||
[]const u8,
|
[]const u8,
|
||||||
"conformance",
|
"conformance",
|
||||||
@ -282,6 +288,9 @@ pub fn build(b: *std.Build) !void {
|
|||||||
|
|
||||||
// Exe
|
// Exe
|
||||||
if (exe_) |exe| {
|
if (exe_) |exe| {
|
||||||
|
// Set PIE if requested
|
||||||
|
if (pie) exe.pie = true;
|
||||||
|
|
||||||
// Add the shared dependencies
|
// Add the shared dependencies
|
||||||
_ = try addDeps(b, exe, config);
|
_ = try addDeps(b, exe, config);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user