Browse Source

Work around clang-cl forgetting dllexport on extern templates.

pull/405/head
Vladimír Vondruš 6 years ago
parent
commit
323829ac15
  1. 5
      src/Magnum/Animation/Player.cpp
  2. 5
      src/Magnum/Audio/Listener.cpp
  3. 5
      src/Magnum/Audio/Playable.cpp
  4. 5
      src/Magnum/Audio/PlayableGroup.cpp
  5. 108
      src/Magnum/Math/instantiation.cpp
  6. 5
      src/Magnum/SceneGraph/instantiation.cpp

5
src/Magnum/Animation/Player.cpp

@ -44,8 +44,9 @@ Debug& operator<<(Debug& debug, const State value) {
}
/* On non-MinGW Windows the instantiations are already marked with extern
template */
#if !defined(CORRADE_TARGET_WINDOWS) || defined(__MINGW32__)
template. However Clang-CL doesn't propagate the export from the extern
template, it seems. */
#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL)
#define MAGNUM_EXPORT_HPP MAGNUM_EXPORT
#else
#define MAGNUM_EXPORT_HPP

5
src/Magnum/Audio/Listener.cpp

@ -110,8 +110,9 @@ template<UnsignedInt dimensions> bool Listener<dimensions>::isActive() const {
}
/* On non-MinGW Windows the instantiations are already marked with extern
template */
#if !defined(CORRADE_TARGET_WINDOWS) || defined(__MINGW32__)
template. However Clang-CL doesn't propagate the export from the extern
template, it seems. */
#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL)
#define MAGNUM_AUDIO_EXPORT_HPP MAGNUM_AUDIO_EXPORT
#else
#define MAGNUM_AUDIO_EXPORT_HPP

5
src/Magnum/Audio/Playable.cpp

@ -68,8 +68,9 @@ template<UnsignedInt dimensions> void Playable<dimensions>::cleanGain() {
}
/* On non-MinGW Windows the instantiations are already marked with extern
template */
#if !defined(CORRADE_TARGET_WINDOWS) || defined(__MINGW32__)
template. However Clang-CL doesn't propagate the export from the extern
template, it seems. */
#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL)
#define MAGNUM_AUDIO_EXPORT_HPP MAGNUM_AUDIO_EXPORT
#else
#define MAGNUM_AUDIO_EXPORT_HPP

5
src/Magnum/Audio/PlayableGroup.cpp

@ -96,8 +96,9 @@ template<UnsignedInt dimensions> void PlayableGroup<dimensions>::setClean() {
#endif
/* On non-MinGW Windows the instantiations are already marked with extern
template */
#if !defined(CORRADE_TARGET_WINDOWS) || defined(__MINGW32__)
template. However Clang-CL doesn't propagate the export from the extern
template, it seems. */
#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL)
#define MAGNUM_AUDIO_EXPORT_HPP MAGNUM_AUDIO_EXPORT
#else
#define MAGNUM_AUDIO_EXPORT_HPP

108
src/Magnum/Math/instantiation.cpp

@ -34,59 +34,67 @@
namespace Corrade { namespace Utility {
#ifndef DOXYGEN_GENERATING_OUTPUT
template struct ConfigurationValue<Magnum::Math::Bezier<2, 2, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::Bezier<2, 3, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::Bezier<3, 2, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::Bezier<3, 3, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::Bezier<2, 2, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::Bezier<2, 3, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::Bezier<3, 2, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::Bezier<3, 3, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<2, 2, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<3, 3, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<4, 4, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<2, 2, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<3, 3, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<4, 4, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<2, 3, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<3, 2, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<2, 4, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<4, 2, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<3, 4, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<4, 3, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<2, 3, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<3, 2, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<2, 4, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<4, 2, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<3, 4, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::RectangularMatrix<4, 3, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::Vector<2, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::Vector<3, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::Vector<4, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::Vector<2, Magnum::Int>>;
template struct ConfigurationValue<Magnum::Math::Vector<3, Magnum::Int>>;
template struct ConfigurationValue<Magnum::Math::Vector<4, Magnum::Int>>;
template struct ConfigurationValue<Magnum::Math::Vector<2, Magnum::UnsignedInt>>;
template struct ConfigurationValue<Magnum::Math::Vector<3, Magnum::UnsignedInt>>;
template struct ConfigurationValue<Magnum::Math::Vector<4, Magnum::UnsignedInt>>;
template struct ConfigurationValue<Magnum::Math::Vector<2, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::Vector<3, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::Vector<4, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::Range<2, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::Range<2, Magnum::Int>>;
template struct ConfigurationValue<Magnum::Math::Range<3, Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::Range<3, Magnum::Int>>;
template struct ConfigurationValue<Magnum::Math::Range<2, Magnum::Double>>;
template struct ConfigurationValue<Magnum::Math::Range<3, Magnum::Double>>;
/* Apparently clang-cl doesn't propagate the export from the extern template
declaration or something */
#ifdef CORRADE_TARGET_CLANG_CL
#define MAGNUM_EXPORT_TEMPLATE MAGNUM_EXPORT
#else
#define MAGNUM_EXPORT_TEMPLATE
#endif
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Bezier<2, 2, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Bezier<2, 3, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Bezier<3, 2, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Bezier<3, 3, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Bezier<2, 2, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Bezier<2, 3, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Bezier<3, 2, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Bezier<3, 3, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<2, 2, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<3, 3, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<4, 4, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<2, 2, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<3, 3, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<4, 4, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<2, 3, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<3, 2, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<2, 4, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<4, 2, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<3, 4, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<4, 3, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<2, 3, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<3, 2, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<2, 4, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<4, 2, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<3, 4, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::RectangularMatrix<4, 3, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<2, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<3, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<4, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<2, Magnum::Int>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<3, Magnum::Int>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<4, Magnum::Int>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<2, Magnum::UnsignedInt>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<3, Magnum::UnsignedInt>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<4, Magnum::UnsignedInt>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<2, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<3, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Vector<4, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Range<2, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Range<2, Magnum::Int>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Range<3, Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Range<3, Magnum::Int>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Range<2, Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::Range<3, Magnum::Double>>;
/* Other (complex, dual complex, quaternion) just reinterpret to 2/4-component
vectors instantiated above */
template struct ConfigurationValue<Magnum::Math::DualQuaternion<Magnum::Float>>;
template struct ConfigurationValue<Magnum::Math::DualQuaternion<Magnum::Double>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::DualQuaternion<Magnum::Float>>;
template struct MAGNUM_EXPORT_TEMPLATE ConfigurationValue<Magnum::Math::DualQuaternion<Magnum::Double>>;
#endif
}}

5
src/Magnum/SceneGraph/instantiation.cpp

@ -42,8 +42,9 @@
namespace Magnum { namespace SceneGraph {
/* On non-MinGW Windows the instantiations are already marked with extern
template */
#if !defined(CORRADE_TARGET_WINDOWS) || defined(__MINGW32__)
template. However Clang-CL doesn't propagate the export from the extern
template, it seems. */
#if !defined(CORRADE_TARGET_WINDOWS) || defined(CORRADE_TARGET_MINGW) || defined(CORRADE_TARGET_CLANG_CL)
#define MAGNUM_SCENEGRAPH_EXPORT_HPP MAGNUM_SCENEGRAPH_EXPORT
#else
#define MAGNUM_SCENEGRAPH_EXPORT_HPP

Loading…
Cancel
Save