From 8e6deb5410f154646ea10b0f91573c869ca969fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 3 Aug 2012 01:59:52 +0200 Subject: [PATCH] Disable -Wdouble-promotion for GCC 4.5. --- src/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf1860082..a8e41e413 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,9 +1,5 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wold-style-cast -pedantic -std=c++0x -fvisibility=hidden") -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion") -endif() - # If targeting GLES, save it into configuration header if(TARGET_GLES) set(MAGNUM_TARGET_GLES 1) @@ -18,6 +14,14 @@ if(GCC45_COMPATIBILITY) set(MAGNUM_GCC45_COMPATIBILITY 1) endif() +# -Wdouble-promotion is supported from GCC 4.6 +# TODO: do this with check_c_compiler_flags() +if(NOT GCC45_COMPATIBILITY) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion") + endif() +endif() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumConfigure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h)