mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
zig cc: recognize the -s flag to be "strip"
This commit is contained in:
parent
905c85be96
commit
e197a03124
4 changed files with 17 additions and 2 deletions
|
|
@ -2348,7 +2348,9 @@ pub fn addCCArgs(
|
|||
else => {},
|
||||
}
|
||||
|
||||
if (!comp.bin_file.options.strip) {
|
||||
if (comp.bin_file.options.strip) {
|
||||
try argv.append("-s");
|
||||
} else {
|
||||
try argv.append("-g");
|
||||
switch (comp.bin_file.options.object_format) {
|
||||
.coff, .pe => try argv.append("-gcodeview"),
|
||||
|
|
|
|||
|
|
@ -4305,7 +4305,14 @@ flagpd1("rewrite-macros"),
|
|||
flagpd1("rewrite-objc"),
|
||||
flagpd1("rewrite-test"),
|
||||
sepd1("rpath"),
|
||||
flagpd1("s"),
|
||||
.{
|
||||
.name = "s",
|
||||
.syntax = .flag,
|
||||
.zig_equivalent = .strip,
|
||||
.pd1 = true,
|
||||
.pd2 = false,
|
||||
.psl = false,
|
||||
},
|
||||
.{
|
||||
.name = "save-stats",
|
||||
.syntax = .flag,
|
||||
|
|
|
|||
|
|
@ -1186,6 +1186,7 @@ fn buildOutputType(
|
|||
.framework_dir => try framework_dirs.append(it.only_arg),
|
||||
.framework => try frameworks.append(it.only_arg),
|
||||
.nostdlibinc => want_native_include_dirs = false,
|
||||
.strip => strip = true,
|
||||
}
|
||||
}
|
||||
// Parse linker args.
|
||||
|
|
@ -3047,6 +3048,7 @@ pub const ClangArgIterator = struct {
|
|||
nostdlibinc,
|
||||
red_zone,
|
||||
no_red_zone,
|
||||
strip,
|
||||
};
|
||||
|
||||
const Args = struct {
|
||||
|
|
|
|||
|
|
@ -312,6 +312,10 @@ const known_options = [_]KnownOpt{
|
|||
.name = "framework",
|
||||
.ident = "framework",
|
||||
},
|
||||
.{
|
||||
.name = "s",
|
||||
.ident = "strip",
|
||||
},
|
||||
};
|
||||
|
||||
const blacklisted_options = [_][]const u8{};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue