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}