Browse Source

Compatibility mode for GCC 4.6.

4.6 doesn't support `override` keyword, using preprocessor macro to
simply hide it. The compatibility mode must be explicitly enabled,
though, using GCC46_COMPATIBILITY CMake option.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
6ebe42c3a9
  1. 2
      CMakeLists.txt
  2. 6
      src/CMakeLists.txt
  3. 24
      src/magnumCompatibility.h
  4. 1
      src/magnumConfigure.h.cmake

2
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)

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

24
src/magnumCompatibility.h

@ -0,0 +1,24 @@
#ifndef magnumCompatibility_h
#define magnumCompatibility_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
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

1
src/magnumConfigure.h.cmake

@ -1,2 +1,3 @@
#cmakedefine MAGNUM_TARGET_GLES
#cmakedefine MAGNUM_TARGET_GLES2
#cmakedefine MAGNUM_GCC46_COMPATIBILITY

Loading…
Cancel
Save