don't inherit allowed deprecation from parent modules

Inheriting allow-deprecation from parent modules doesn't make too much
sense, so instead make them default to disallow unless otherwise
specified. This allows build system to avoid redundant
`-fno-allow-deprecated` args.

This makes the generated CLIs smaller, and makes zig1.wasm update not
needed.

Also represented `is_root` differently (moved to field of graph).
This commit is contained in:
Andrew Kelley
2025-02-25 23:50:56 -08:00
parent 4ddb13468b
commit c5aa680c88
4 changed files with 7 additions and 10 deletions

View File

@@ -557,10 +557,9 @@ 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) {
const allow_deprecated = m.owner.graph.allow_deprecated orelse !m.owner.is_root;
try addFlag(zig_args, allow_deprecated, "-fallow-deprecated", "-fno-allow-deprecated");
}
// -fno-allow-deprecated is the CLI default, and not inherited, so only pass the flag if true.
const allow_deprecated = m.owner.graph.allow_deprecated orelse (m.owner.graph.root_builder != m.owner);
if (allow_deprecated == true) try zig_args.append("-fallow-deprecated");
if (m.dwarf_format) |dwarf_format| {
try zig_args.append(switch (dwarf_format) {