@deprecated: add build system support

This commit is contained in:
Loris Cro
2025-02-13 20:58:11 +01:00
committed by Andrew Kelley
parent fff8eff2bd
commit ba7cd8121d
3 changed files with 17 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ stack_check: ?bool,
sanitize_c: ?bool,
sanitize_thread: ?bool,
fuzz: ?bool,
allow_deprecated: ?bool,
code_model: std.builtin.CodeModel,
valgrind: ?bool,
pic: ?bool,
@@ -284,6 +285,7 @@ pub fn init(
.owner = owner,
.root_source_file = if (options.root_source_file) |lp| lp.dupe(owner) else null,
.import_table = .{},
.allow_deprecated = owner.graph.allow_deprecated orelse !owner.is_root,
.resolved_target = options.target,
.optimize = options.optimize,
.link_libc = options.link_libc,
@@ -557,6 +559,10 @@ pub fn appendZigProcessFlags(
try addFlag(zig_args, m.pic, "-fPIC", "-fno-PIC");
try addFlag(zig_args, m.red_zone, "-mred-zone", "-mno-red-zone");
if (m.root_source_file != null) {
try addFlag(zig_args, m.allow_deprecated, "-fallow-deprecated", "-fno-allow-deprecated");
}
if (m.dwarf_format) |dwarf_format| {
try zig_args.append(switch (dwarf_format) {
.@"32" => "-gdwarf32",