From 27507ad9713a05281bcb8031f5206070f1e2a887 Mon Sep 17 00:00:00 2001 From: Alex Rønne Petersen Date: Sat, 27 Jul 2024 08:18:48 +0200 Subject: 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. --- src/Compilation.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Compilation.zig') 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"); } -- cgit v1.2.3