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

This commit is contained in:
Weijia Wang 2025-07-15 23:34:27 +02:00 committed by GitHub
commit f923436706
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
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 diff --git a/CMakeLists.txt b/CMakeLists.txt
index 902233e676ee..49ac8a1010a4 100644 index 902233e676ee..49ac8a1010a4 100644
--- a/CMakeLists.txt --- a/CMakeLists.txt
@ -20,7 +20,7 @@ index 902233e676ee..49ac8a1010a4 100644
- ENDIF() - ENDIF()
+ SET(TINS_HAVE_CXX11 ON) + SET(TINS_HAVE_CXX11 ON)
+ MESSAGE(STATUS "Using C++11 features") + 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) ELSE(LIBTINS_ENABLE_CXX11)
MESSAGE( MESSAGE(
WARNING WARNING

View File

@ -21,9 +21,11 @@ stdenv.mkDerivation rec {
}; };
patches = [ patches = [
# Required for gtest 1.13+, see also upstream report at: # Required for gtest 1.17+:
# https://github.com/mfontanini/libtins/issues/529 # https://github.com/NixOS/nixpkgs/issues/425358
./0001-force-cpp-14.patch # See also an upstream report for gtest 1.13+ and C++14:
# https://github.com/mfontanini/libtins/issues/
./0001-force-cpp-17.patch
]; ];
postPatch = '' postPatch = ''