Browse Source

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.
pull/51/head
Vladimír Vondruš 13 years ago
parent
commit
f373b6518e
  1. 7
      src/CMakeLists.txt

7
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}

Loading…
Cancel
Save