From af00cd5b753cffadac5b3dc40f32d455a35b1165 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 7 Jul 2011 22:35:34 +0000 Subject: [PATCH] Disabled -ffast-math in the case of GCC 4.6.x (ticket #1201) --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3885c23..30e8711 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -361,7 +361,12 @@ if(CMAKE_COMPILER_IS_GNUCXX) if(X86 OR X86_64) # enable everything, since the available set of instructions is checked at runtime - set(USE_FAST_MATH ON CACHE BOOL "Enable -ffast-math") + IF ("${CMAKE_GCC_REGEX_VERSION}" VERSION_GREATER 4.6.-1) + SET(_USE_FAST_MATH OFF) + ELSE() + SET(_USE_FAST_MATH ON) + ENDIF() + set(USE_FAST_MATH ${_USE_FAST_MATH} CACHE BOOL "Enable -ffast-math (not recommended for GCC 4.6.x)") set(ENABLE_SSE ON CACHE BOOL "Enable SSE instructions") set(ENABLE_SSE2 ON CACHE BOOL "Enable SSE2 instructions") set(ENABLE_SSE3 OFF CACHE BOOL "Enable SSE3 instructions") -- 2.7.4