build.zig: change -Dpie option default to be target-dependant

`null` here indicates to Zig that it should decide for itself whether
to enable PIE or not. On some targets (like macOS or OpenBSD), it is
required and so current default will cause unneccessary build error.

Behavior for `-Dpie=false` and `-Dpie=true` is not changed.

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
This commit is contained in:
Eric Joldasov 2025-03-06 01:20:20 +05:00
parent f4e4694612
commit e43d22ba3f
No known key found for this signature in database
GPG key ID: 5C9C69060686B588

View file

@ -7,7 +7,7 @@ pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const pie = b.option(bool, "pie", "Build with PIE support (by default false)") orelse false;
const pie = b.option(bool, "pie", "Build with PIE support (by default: target-dependant)");
const strip = b.option(bool, "strip", "Strip debugging info (by default false)") orelse false;
const main_mod = b.createModule(.{