From f373b6518e0b1fa3e4d0ffb19f77e80a8a56484c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 29 Dec 2013 18:03:14 +0100 Subject: [PATCH] Disabling strict aliasing on GCC >= 4.8. Causes failure of DebugToolsCylinderRendererTest without any warning, only in release build, any attempt to add debug print results in issue disappearing. Not an issue on Clang or GCC < 4.8. --- src/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b23e4206c..9df0dd1e5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,6 +29,13 @@ if(CORRADE_GCC46_COMPATIBILITY) string(REPLACE "-pedantic" "" CORRADE_CXX_FLAGS "${CORRADE_CXX_FLAGS}") endif() +# On 4.8.2 strict aliasing causes failure of DebugToolsCylinderRendererTest +# without any warning, only in release build, any attempt to add debug print +# results in issue disappearing. Not an issue on Clang or GCC < 4.8. +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.8.0") + set(CORRADE_CXX_FLAGS "${CORRADE_CXX_FLAGS} -fno-strict-aliasing") +endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CORRADE_CXX_FLAGS}") include_directories( ${CMAKE_CURRENT_SOURCE_DIR}