From 2f8e6f3d33d73190ac8bebb4b4c94bfdf59c904d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Mon, 23 Jan 2023 01:20:01 -0500 Subject: [PATCH] gtest: ensure C++17 support (#207338) --- pkgs/development/libraries/gtest/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/gtest/default.nix b/pkgs/development/libraries/gtest/default.nix index 049d202a71ec..8e60c08d3600 100644 --- a/pkgs/development/libraries/gtest/default.nix +++ b/pkgs/development/libraries/gtest/default.nix @@ -19,7 +19,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ninja ]; - cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + ] ++ lib.optionals (stdenv.cc.isClang && (lib.versionOlder stdenv.cc.version "16.0")) [ + # Enable C++17 support + # https://github.com/google/googletest/issues/3081 + "-DCMAKE_CXX_STANDARD=17" + ]; meta = with lib; { description = "Google's framework for writing C++ tests";