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)