diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-07-27 08:18:48 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-07-29 11:27:38 -0700 |
| commit | 27507ad9713a05281bcb8031f5206070f1e2a887 (patch) | |
| tree | 8ada04dba9198e34837b3079d27a5a767b4c9d09 /src/Compilation.zig | |
| parent | c37fe4b6784cef125ed7b4e043ee3122dd09f491 (diff) | |
| download | zig-27507ad9713a05281bcb8031f5206070f1e2a887.tar.gz zig-27507ad9713a05281bcb8031f5206070f1e2a887.zip | |
compiler: Enable -Werror=date-time for C/C++ code in release builds.
We advertise reproducible builds for release modes, so let's help users achieve
that in C/C++ code. Users can still override this manually if they really want.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index e6ab42cbc2..8c9e18bc98 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -5734,6 +5734,10 @@ pub fn addCCArgs( }, } + if (mod.optimize_mode != .Debug) { + try argv.append("-Werror=date-time"); + } + if (target_util.supports_fpic(target) and mod.pic) { try argv.append("-fPIC"); } |
