From 27507ad9713a05281bcb8031f5206070f1e2a887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 27 Jul 2024 08:18:48 +0200 Subject: [PATCH] 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(+) 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"); }