diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-02-25 23:50:56 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-02-26 14:41:33 -0500 |
| commit | c5aa680c88f7c03718460ff38e7cb1f7c5482cf2 (patch) | |
| tree | 945c63b1778719f79ead29a757d227184a406d13 /lib/std/Build/Module.zig | |
| parent | 4ddb13468b372b2f722703b5e6d60997776c251a (diff) | |
| download | zig-c5aa680c88f7c03718460ff38e7cb1f7c5482cf2.tar.gz zig-c5aa680c88f7c03718460ff38e7cb1f7c5482cf2.zip | |
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).
Diffstat (limited to 'lib/std/Build/Module.zig')
| -rw-r--r-- | lib/std/Build/Module.zig | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/std/Build/Module.zig b/lib/std/Build/Module.zig index 8a8b9573e4..40b9a5e619 100644 --- a/lib/std/Build/Module.zig +++ b/lib/std/Build/Module.zig @@ -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) { |
