$OpenBSD: patch-Source_CMakeLists_txt,v 1.1 2010/05/28 20:21:48 dcoppa Exp $ --- Source/CMakeLists.txt.orig Tue Apr 27 21:54:05 2010 +++ Source/CMakeLists.txt Tue Apr 27 21:58:48 2010 @@ -107,6 +107,19 @@ IF(CMAKE_USE_ELF_PARSER) SET(ELF_SRCS cmELF.h cmELF.cxx) ENDIF(CMAKE_USE_ELF_PARSER) +# Workaround for sparc64 +EXECUTE_PROCESS( + COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine + OUTPUT_VARIABLE MACHINE + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +STRING(REGEX MATCH "(sparc64-*)" _machine_sparc64 "${MACHINE}") + +IF (_machine_sparc64) + STRING(REGEX REPLACE "-O2" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +ENDIF (_machine_sparc64) + # # Sources for CMakeLib #