Browse Source

Added dllimport/dllexport macros for Windows builds.

vectorfields
Vladimír Vondruš 14 years ago
parent
commit
8efb5a1e42
  1. 2
      src/AbstractShaderProgram.h
  2. 2
      src/AbstractTexture.h
  3. 5
      src/CMakeLists.txt
  4. 2
      src/Camera.h
  5. 2
      src/IndexedMesh.h
  6. 4
      src/Math/Math.h
  7. 2
      src/Mesh.h
  8. 2
      src/MeshTools/AbstractTool.h
  9. 5
      src/MeshTools/CMakeLists.txt
  10. 2
      src/MeshTools/Tipsify.h
  11. 2
      src/Object.h
  12. 2
      src/Scene.h
  13. 2
      src/Shader.h
  14. 2
      src/Texture.h
  15. 4
      src/Trade/AbstractImporter.h
  16. 42
      src/utilities.h

2
src/AbstractShaderProgram.h

@ -77,7 +77,7 @@ Basic workflow with AbstractShaderProgram subclasses is: instancing the class
(once at the beginning), then in every frame calling use(), setting uniforms
and calling Mesh::draw() (see its documentation for more).
*/
class AbstractShaderProgram {
class MAGNUM_EXPORT AbstractShaderProgram {
AbstractShaderProgram(const AbstractShaderProgram& other) = delete;
AbstractShaderProgram(AbstractShaderProgram&& other) = delete;
AbstractShaderProgram& operator=(const AbstractShaderProgram& other) = delete;

2
src/AbstractTexture.h

@ -29,7 +29,7 @@ namespace Magnum {
See Texture documentation for more information.
*/
class AbstractTexture {
class MAGNUM_EXPORT AbstractTexture {
AbstractTexture(const AbstractTexture& other) = delete;
AbstractTexture(AbstractTexture&& other) = delete;
AbstractTexture& operator=(const AbstractTexture& other) = delete;

5
src/CMakeLists.txt

@ -24,6 +24,11 @@ set(Magnum_SRCS
)
add_library(Magnum SHARED ${Magnum_SRCS})
if(WIN32)
set_target_properties(Magnum PROPERTIES COMPILE_FLAGS -DMAGNUM_EXPORTING)
endif()
target_link_libraries(Magnum CorradePluginManager CorradeUtility ${OPENGL_gl_LIBRARY} ${GLEW_LIBRARY})
install(TARGETS Magnum DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})

2
src/Camera.h

@ -28,7 +28,7 @@ namespace Magnum {
*
* @todo Subclasses - perspective, FBO postprocessing etc.
*/
class Camera: public Object {
class MAGNUM_EXPORT Camera: public Object {
public:
/** @brief Aspect ratio policy */
enum AspectRatioPolicy {

2
src/IndexedMesh.h

@ -27,7 +27,7 @@ namespace Magnum {
/**
* @brief Indexed mesh
*/
class IndexedMesh: public Mesh {
class MAGNUM_EXPORT IndexedMesh: public Mesh {
public:
/**
* @brief Implicit constructor

4
src/Math/Math.h

@ -17,6 +17,8 @@
#include <cstddef>
#include "utilities.h"
/** @file
* @brief Math constants and utilities
*/
@ -51,7 +53,7 @@ template<> inline constexpr size_t pow<0>(size_t base) { return 1; }
*
* Returns integral logarithm of given number with given base.
*/
size_t log(size_t base, size_t number);
size_t MAGNUM_EXPORT log(size_t base, size_t number);
/**
* @brief Angle in degrees

2
src/Mesh.h

@ -36,7 +36,7 @@ class Buffer;
* @todo Support for normalized values (e.g. for color as char[4] passed to
* shader as floating-point vec4)
*/
class Mesh {
class MAGNUM_EXPORT Mesh {
Mesh(const Mesh& other) = delete;
Mesh(Mesh&& other) = delete;
Mesh& operator=(const Mesh& other) = delete;

2
src/MeshTools/AbstractTool.h

@ -56,7 +56,7 @@ template<class Vertex> class AbstractTool {
* Provides access only to index array and vertex count. See also
* AbstractTool.
*/
class AbstractIndexTool {
class MAGNUM_EXPORT AbstractIndexTool {
public:
/**
* @brief Constructor

5
src/MeshTools/CMakeLists.txt

@ -3,6 +3,11 @@ set(MagnumMeshTools_SRCS
)
add_library(MagnumMeshTools SHARED ${MagnumMeshTools_SRCS})
if(WIN32)
set_target_properties(MagnumMeshTools PROPERTIES COMPILE_FLAGS -DMESHTOOLS_EXPORTING)
endif()
target_link_libraries(MagnumMeshTools ${MAGNUM_LIBRARY})
install(TARGETS MagnumMeshTools DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})

2
src/MeshTools/Tipsify.h

@ -28,7 +28,7 @@ namespace Magnum { namespace MeshTools {
See tipsify() for full documentation.
*/
class Tipsify: public AbstractIndexTool {
class MESHTOOLS_EXPORT Tipsify: public AbstractIndexTool {
public:
/** @copydoc AbstractIndexTool::AbstractIndexTool(MeshBuilder<Vertex>&) */
template<class Vertex> inline Tipsify(MeshBuilder<Vertex>& builder): AbstractIndexTool(builder) {}

2
src/Object.h

@ -33,7 +33,7 @@ class Scene;
* @todo Transform transformation when changing parent, so the object stays in
* place.
*/
class Object {
class MAGNUM_EXPORT Object {
Object(const Object& other) = delete;
Object(Object&& other) = delete;
Object& operator=(const Object& other) = delete;

2
src/Scene.h

@ -24,7 +24,7 @@
namespace Magnum {
/** @brief %Scene */
class Scene: public Object {
class MAGNUM_EXPORT Scene: public Object {
private:
void setParent(Object* parent) = delete;
void setTransformation(const Matrix4& transformation) = delete;

2
src/Shader.h

@ -33,7 +33,7 @@ namespace Magnum {
* string. Compiled shaders are then passed to AbstractShaderProgram subclasses
* for linking and usage.
*/
class Shader {
class MAGNUM_EXPORT Shader {
Shader(const Shader& other) = delete;
Shader(Shader&& other) = delete;
Shader& operator=(const Shader& other) = delete;

2
src/Texture.h

@ -48,7 +48,7 @@ don't support mipmapping and repeating wrapping modes, see @ref Texture::Filter
"Filter", @ref Texture::Mipmap "Mipmap" and generateMipmap() documentation
for more information.
*/
template<size_t dimensions> class Texture: public AbstractTexture {
template<size_t dimensions> class MAGNUM_EXPORT Texture: public AbstractTexture {
public:
static const size_t Dimensions = dimensions; /**< @brief Texture dimension count */

4
src/Trade/AbstractImporter.h

@ -73,7 +73,7 @@ having copies of shared pointers for them will lead to dangling pointers when
any object deletes its child objects. Thus the class should store only one
shared pointer to root of each object tree.</p>
*/
class AbstractImporter: public Corrade::PluginManager::Plugin {
class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
PLUGIN_INTERFACE("cz.mosra.magnum.Trade.AbstractImporter/0.1")
public:
@ -280,7 +280,7 @@ class AbstractImporter: public Corrade::PluginManager::Plugin {
Provides direct access to data of any mesh. See also
AbstractImporter::meshData().
*/
class AbstractImporter::MeshData {
class MAGNUM_EXPORT AbstractImporter::MeshData {
public:
/**
* @brief Indices

42
src/utilities.h

@ -0,0 +1,42 @@
#ifndef Magnum_utilities_h
#define Magnum_utilities_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.
*/
/** @file
* @brief Various utilities and macros
*/
namespace Magnum {
#ifdef _WIN32
#ifdef MAGNUM_EXPORTING
#define MAGNUM_EXPORT __declspec(dllexport)
#else
#define MAGNUM_EXPORT __declspec(dllimport)
#endif
#ifdef MESHTOOLS_EXPORTING
#define MESHTOOLS_EXPORT __declspec(dllexport)
#else
#define MESHTOOLS_EXPORT __declspec(dllimport)
#endif
#else
#define MAGNUM_EXPORT
#define MESHTOOLS_EXPORT
#endif
}
#endif
Loading…
Cancel
Save