Unverified Commit f9234367 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

libtins: force C++17 for gtest (#425468)

parents bcf19e82 0489ebad
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
This change bypasses all the code that attempts to see which C++11 features are enabled in your specific C++11 compiler.  C++14 is required for gtest 1.13+.
This change bypasses all the code that attempts to see which C++11 features are enabled in your specific C++11 compiler.  C++17 is required for gtest 1.17+.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 902233e676ee..49ac8a1010a4 100644
--- a/CMakeLists.txt
@@ -20,7 +20,7 @@ index 902233e676ee..49ac8a1010a4 100644
-    ENDIF()
+    SET(TINS_HAVE_CXX11 ON)
+    MESSAGE(STATUS "Using C++11 features")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
 ELSE(LIBTINS_ENABLE_CXX11)
     MESSAGE(
         WARNING
+5 −3
Original line number Diff line number Diff line
@@ -21,9 +21,11 @@ stdenv.mkDerivation rec {
  };

  patches = [
    # Required for gtest 1.13+, see also upstream report at:
    # https://github.com/mfontanini/libtins/issues/529
    ./0001-force-cpp-14.patch
    # Required for gtest 1.17+:
    # https://github.com/NixOS/nixpkgs/issues/425358
    # See also an upstream report for gtest 1.13+ and C++14:
    # https://github.com/mfontanini/libtins/issues/
    ./0001-force-cpp-17.patch
  ];

  postPatch = ''