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. 16
      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

16
CMakeLists.txt

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

2
doc/changelog.dox

@ -285,6 +285,8 @@ See also:
- There's now a PPA for Ubuntu packages. See @ref building-packages-deb - There's now a PPA for Ubuntu packages. See @ref building-packages-deb
for more information. 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 - Magnum now links to GLVND on Linux instead of the old libGL ABI if using
CMake 3.11 and newer CMake 3.11 and newer
- @ref cmake "FindMagnum.cmake" now allows to use the @ref DebugTools library - @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}) ${MAGNUM_INCLUDE_DIR})
# Some deprecated APIs use headers (but not externally defined symbols) # Some deprecated APIs use headers (but not externally defined symbols)
# from the GL library, link those includes as well # 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 set_property(TARGET Magnum::Magnum APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${MAGNUM_INCLUDE_DIR}/MagnumExternal/OpenGL) INTERFACE_INCLUDE_DIRECTORIES ${MAGNUM_INCLUDE_DIR}/MagnumExternal/OpenGL)
endif() endif()

2
src/Magnum/ImageView.h

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

4
src/Magnum/Magnum.h

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

2
src/Magnum/PixelFormat.h

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

1
src/Magnum/Trade/AbstractImageConverter.h

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

Loading…
Cancel
Save