diff --git a/CMakeLists.txt b/CMakeLists.txt index c33a6f7ee..9ab022437 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,8 @@ project(Magnum) include(CMakeDependentOption) +option(GCC46_COMPATIBILITY "Enable compatibility mode for GCC 4.6 (might disable some features)" OFF) + option(TARGET_GLES "Build for OpenGL ES instead of desktop OpenGL" OFF) cmake_dependent_option(TARGET_GLES2 "Build for OpenGL ES 2" ON "TARGET_GLES" OFF) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 23b57f72c..b6361857c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,6 +11,11 @@ endif() if(TARGET_GLES2) set(MAGNUM_TARGET_GLES2 1) endif() + +if(GCC46_COMPATIBILITY) + set(MAGNUM_GCC46_COMPATIBILITY 1) +endif() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumConfigure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h) @@ -73,6 +78,7 @@ set(Magnum_HEADERS Timeline.h TypeTraits.h + magnumCompatibility.h magnumVisibility.h) add_library(MagnumObjects OBJECT ${Magnum_SRCS}) diff --git a/src/magnumCompatibility.h b/src/magnumCompatibility.h new file mode 100644 index 000000000..c69691732 --- /dev/null +++ b/src/magnumCompatibility.h @@ -0,0 +1,24 @@ +#ifndef magnumCompatibility_h +#define magnumCompatibility_h +/* + Copyright © 2010, 2011, 2012 Vladimír Vondruš + + This file is part of Magnum. + + Magnum is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License version 3 + only, as published by the Free Software Foundation. + + Magnum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License version 3 for more details. +*/ + +#include "magnumConfigure.h" + +#ifdef MAGNUM_GCC46_COMPATIBILITY +#define override +#endif + +#endif diff --git a/src/magnumConfigure.h.cmake b/src/magnumConfigure.h.cmake index 7b42510db..a2d1d818f 100644 --- a/src/magnumConfigure.h.cmake +++ b/src/magnumConfigure.h.cmake @@ -1,2 +1,3 @@ #cmakedefine MAGNUM_TARGET_GLES #cmakedefine MAGNUM_TARGET_GLES2 +#cmakedefine MAGNUM_GCC46_COMPATIBILITY