From 696a0af22022c6d629d67fcff2c7e779c917e187 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 25 Jun 2010 12:54:16 -0400 Subject: [PATCH] Disable gcc 33 on OpenBSD because it crashes CPack by default. Make sure no one tries to use gcc 33 based tools to build CMake. This is because a cpack test failed with a crash. The crash seems to be caused by the stack checking code on by default in OpenBSD. The crash is in some stl code. The problem is fixed with newer gcc compilers on OpenBSD. --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd90163f4..8b41cc310 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,21 @@ ENDIF(COMMAND CMAKE_POLICY) MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY) +IF(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") + EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} + ${CMAKE_CXX_COMPILER_ARG1} -dumpversion + OUTPUT_VARIABLE _GXX_VERSION + ) + STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" + _GXX_VERSION_SHORT ${_GXX_VERSION}) + IF(_GXX_VERSION_SHORT EQUAL 33) + MESSAGE(FATAL_ERROR + "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n" + "Please use GXX 4.2 or greater to build CMake on OpenBSD\n" + "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}") + ENDIF() +ENDIF() + # Allow empty endif() and such with CMake 2.4. SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1)