Workaround bug in googletest, fixing bug #812284
authorChristian Hofstaedtler <zeha@debian.org>
Thu, 30 Jun 2016 22:05:02 +0000 (22:05 +0000)
committerPaul Novotny <paul@paulnovo.us>
Wed, 12 Oct 2016 23:48:11 +0000 (00:48 +0100)
Gbp-Pq: Name 0003-Workaround-bug-in-googletest-fixing-bug-812284.patch

test/CMakeLists.txt

index 61f1f7f6e803ee1881d8681b0f1cedc2895b3c98..2083d5e1645ee89c215bee157e7fe371dfb93b89 100644 (file)
@@ -13,6 +13,19 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR
   set(yaml_test_flags "-Wno-c99-extensions -Wno-variadic-macros -Wno-sign-compare")
 endif()
 
+# In some cases gTest segfaults with GCC >= 6.0.0.  This is a dirty fix.
+# TODO: Update to gTest-release with proper support for GCC >= 6.0.0.
+# See:  https://github.com/google/googletest/issues/705
+IF(CMAKE_COMPILER_IS_GNUCXX)
+       # in order to support cmake 2.8.7 and older
+       IF(NOT CMAKE_CXX_COMPILER_VERSION)
+               include(CheckCompiler)
+       ENDIF(NOT CMAKE_CXX_COMPILER_VERSION)
+       IF(NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "6.0.0")
+               set(yaml_test_flags "${yaml_test_flags} -fno-delete-null-pointer-checks")
+       ENDIF(NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "6.0.0")
+ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+
 file(GLOB test_headers [a-z_]*.h)
 file(GLOB test_sources [a-z_]*.cpp integration/[a-z_]*.cpp node/[a-z_]*.cpp)
 file(GLOB test_new_api_sources new-api/[a-z]*.cpp)