Merge pull request #290931 from simonhollingshead/libtins-cpp14

libtins: Force compilation using C++14.
This commit is contained in:
Doron Behar 2024-03-15 19:09:11 +02:00 committed by GitHub
commit 6bea063d09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,26 @@
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+.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 902233e676ee..49ac8a1010a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -103,17 +103,9 @@ ENDIF()
# C++11 support
OPTION(LIBTINS_ENABLE_CXX11 "Compile libtins with c++11 features" ON)
IF(LIBTINS_ENABLE_CXX11)
- # We only use declval and decltype on gcc/clang as VC fails to build that code,
- # at least on VC2013
- IF(HAS_CXX11_RVALUE_REFERENCES AND HAS_CXX11_FUNCTIONAL AND HAS_CXX11_CHRONO AND
- HAS_CXX11_NOEXCEPT AND ((HAS_CXX11_DECLVAL AND HAS_CXX11_DECLTYPE) OR MSVC))
- SET(TINS_HAVE_CXX11 ON)
- MESSAGE(STATUS "Enabling C++11 features")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_COMPILER_FLAGS}")
- ELSE()
- MESSAGE(WARNING "The compiler doesn't support the necessary C++11 features. "
- "Disabling C++11 on this build")
- ENDIF()
+ SET(TINS_HAVE_CXX11 ON)
+ MESSAGE(STATUS "Using C++11 features")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
ELSE(LIBTINS_ENABLE_CXX11)
MESSAGE(
WARNING

View file

@ -20,6 +20,8 @@ stdenv.mkDerivation rec {
url = "https://github.com/mfontanini/libtins/commit/812be7966d445ec56e88eab512f8fd2d57152427.patch";
hash = "sha256-5RCFPe95r1CBrAocjTPR2SvUlgaGa1aBc8RazyxUj3M=";
})
# Required for gtest 1.13+.
./0001-force-cpp-14.patch
];
postPatch = ''