Browse Source

Don't use GL-specific stuff on targets without GL enabled.

inverted-ranges
Vladimír Vondruš 8 years ago
parent
commit
89d988383a
  1. 2
      CMakeLists.txt
  2. 2
      doc/changelog.dox
  3. 2
      modules/FindMagnum.cmake
  4. 2
      src/Magnum/ImageView.h
  5. 4
      src/Magnum/Magnum.h
  6. 2
      src/Magnum/PixelFormat.h
  7. 1
      src/Magnum/Trade/AbstractImageConverter.h

2
CMakeLists.txt

@ -213,6 +213,7 @@ if(BUILD_STATIC)
endif()
# Check dependencies
if(WITH_GL)
if(NOT TARGET_GLES OR TARGET_DESKTOP_GLES)
set(OpenGL_GL_PREFERENCE GLVND) # since CMake 3.11
find_package(OpenGL REQUIRED)
@ -221,6 +222,7 @@ elseif(TARGET_GLES2)
else()
find_package(OpenGLES3 REQUIRED)
endif()
endif()
# Configuration variables (saved later to configure.h)
if(TARGET_GL)

2
doc/changelog.dox

@ -285,6 +285,8 @@ See also:
- There's now a PPA for Ubuntu packages. See @ref building-packages-deb
for more information.
- Fixed various issues preventing to build and use the base libraries with
OpenGL support disabled (see [mosra/magnum#255](https://github.com/mosra/magnum/pull/255))
- Magnum now links to GLVND on Linux instead of the old libGL ABI if using
CMake 3.11 and newer
- @ref cmake "FindMagnum.cmake" now allows to use the @ref DebugTools library

2
modules/FindMagnum.cmake

@ -327,7 +327,7 @@ if(NOT TARGET Magnum::Magnum)
${MAGNUM_INCLUDE_DIR})
# Some deprecated APIs use headers (but not externally defined symbols)
# from the GL library, link those includes as well
if(MAGNUM_BUILD_DEPRECATED)
if(MAGNUM_BUILD_DEPRECATED AND MAGNUM_TARGET_GL)
set_property(TARGET Magnum::Magnum APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${MAGNUM_INCLUDE_DIR}/MagnumExternal/OpenGL)
endif()

2
src/Magnum/ImageView.h

@ -350,7 +350,7 @@ template<UnsignedInt dimensions> class ImageView {
*/
UnsignedInt formatExtra() const { return _formatExtra; }
#ifdef MAGNUM_BUILD_DEPRECATED
#if defined(MAGNUM_BUILD_DEPRECATED) && defined(MAGNUM_TARGET_GL)
/**
* @brief Data type of pixel data
* @deprecated Cast @ref formatExtra() to @ref GL::PixelType instead.

4
src/Magnum/Magnum.h

@ -34,7 +34,7 @@
#include "Magnum/Types.h"
#include "Magnum/Math/Math.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#if defined(MAGNUM_BUILD_DEPRECATED) && defined(MAGNUM_TARGET_GL)
#include "Magnum/GL/GL.h"
#endif
@ -761,7 +761,7 @@ enum class SamplerWrapping: UnsignedInt;
class Timeline;
#ifdef MAGNUM_BUILD_DEPRECATED
#if defined(MAGNUM_BUILD_DEPRECATED) && defined(MAGNUM_TARGET_GL)
typedef CORRADE_DEPRECATED("use GL::AbstractFramebuffer instead") GL::AbstractFramebuffer AbstractFramebuffer;
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))

2
src/Magnum/PixelFormat.h

@ -635,7 +635,7 @@ enum class PixelFormat: UnsignedInt {
#endif
};
#ifdef MAGNUM_BUILD_DEPRECATED
#if defined(MAGNUM_BUILD_DEPRECATED) && defined(MAGNUM_TARGET_GL)
/** @brief @copybrief GL::PixelType
* @deprecated Use @ref GL::PixelType instead.
*/

1
src/Magnum/Trade/AbstractImageConverter.h

@ -33,7 +33,6 @@
#include <Corrade/PluginManager/AbstractManagingPlugin.h>
#include "Magnum/Magnum.h"
#include "Magnum/GL/GL.h"
#include "Magnum/Trade/Trade.h"
#include "Magnum/Trade/visibility.h"

Loading…
Cancel
Save