From 2a9be238cf0c4d26b2a2fc48c023c38094120325 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 1 Oct 2024 13:37:35 +0100 Subject: [PATCH] gbenchmark: disable `-Werror` Fixes the build on Darwin. --- pkgs/development/libraries/gbenchmark/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/libraries/gbenchmark/default.nix b/pkgs/development/libraries/gbenchmark/default.nix index fcb95d088f8d..4aea6433c813 100644 --- a/pkgs/development/libraries/gbenchmark/default.nix +++ b/pkgs/development/libraries/gbenchmark/default.nix @@ -20,6 +20,19 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ninja ]; + cmakeFlags = [ + # We ran into issues with gtest 1.8.5 conditioning on + # `#if __has_cpp_attribute(maybe_unused)`, which was, for some + # reason, going through even when C++14 was being used and + # breaking the build on Darwin by triggering warnings about using + # C++17 features. + # + # This might be a problem with our Clang, as it does not reproduce + # with Xcode, but since `-Werror` is painful for us anyway and + # upstream exposes a CMake flag to turn it off, we just use that. + (lib.cmakeBool "BENCHMARK_ENABLE_WERROR" false) + ]; + postPatch = '' cp -r ${gtest.src} googletest chmod -R u+w googletest