diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-01-22 12:27:18 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-01-22 12:27:18 -0700 |
| commit | 8484df5bd26350ccfd4d2a5da5aeaed923901ae5 (patch) | |
| tree | b4520d4d7092d620d0cda72ab20cfec2ccabe373 /src | |
| parent | 3df4707ea79d292f07e0d78ae7dd76266eeb1a16 (diff) | |
| download | zig-8484df5bd26350ccfd4d2a5da5aeaed923901ae5.tar.gz zig-8484df5bd26350ccfd4d2a5da5aeaed923901ae5.zip | |
zig cc: add -Wno-overriding-t-option to clang on darwin
This avoids a warning that sometimes occurs when providing both a
-target argument that contains a version as well as the
-mmacosx-version-min argument. Zig provides the correct value in both
places, so it doesn't matter which one gets overridden.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Compilation.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index b0af925e29..60dcc55b7b 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -4319,11 +4319,18 @@ pub fn addCCArgs( } }, .macos => { + try argv.ensureUnusedCapacity(2); // Pass the proper -m<os>-version-min argument for darwin. const ver = target.os.version_range.semver.min; - try argv.append(try std.fmt.allocPrint(arena, "-mmacos-version-min={d}.{d}.{d}", .{ + argv.appendAssumeCapacity(try std.fmt.allocPrint(arena, "-mmacos-version-min={d}.{d}.{d}", .{ ver.major, ver.minor, ver.patch, })); + // This avoids a warning that sometimes occurs when + // providing both a -target argument that contains a + // version as well as the -mmacosx-version-min argument. + // Zig provides the correct value in both places, so it + // doesn't matter which one gets overridden. + argv.appendAssumeCapacity("-Wno-overriding-t-option"); }, .ios, .tvos, .watchos => switch (target.cpu.arch) { // Pass the proper -m<os>-version-min argument for darwin. |
