Browse Source

Actually properly export the PluginManager::Manager instances.

This is what commit ca722eac6e should
have been.

Sorry for breaking a non-deprecated MSVC build once again. The reason it
"appeared to work" for me was that on deprecated builds, Manager.h
includes Manager.hpp for backwards compatibility. On non-deprecated it
doesn't and MSVC ends up dying on a linker error. But the problem was
not related to extern templates, the problem was that there was a
compiler-specific ifdef in the cpp file which exported the class for all
compilers but MSVC, somehow. And so when I removed extern template from
the header, it still worked everywhere, except MSVC and except a
non-deprecated build.
pull/578/head
Vladimír Vondruš 4 years ago
parent
commit
45c1a7091f
  1. 10
      src/Magnum/Audio/AbstractImporter.cpp
  2. 10
      src/Magnum/ShaderTools/AbstractConverter.cpp
  3. 10
      src/Magnum/Text/AbstractFont.cpp
  4. 10
      src/Magnum/Text/AbstractFontConverter.cpp
  5. 10
      src/Magnum/Trade/AbstractImageConverter.cpp
  6. 10
      src/Magnum/Trade/AbstractImporter.cpp
  7. 10
      src/Magnum/Trade/AbstractSceneConverter.cpp

10
src/Magnum/Audio/AbstractImporter.cpp

@ -42,15 +42,7 @@
namespace Corrade { namespace PluginManager {
/* On non-MinGW Windows the instantiations are already marked with extern
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
#endif
template class MAGNUM_AUDIO_EXPORT_HPP Manager<Magnum::Audio::AbstractImporter>;
template class MAGNUM_AUDIO_EXPORT Manager<Magnum::Audio::AbstractImporter>;
}}

10
src/Magnum/ShaderTools/AbstractConverter.cpp

@ -43,15 +43,7 @@
namespace Corrade { namespace PluginManager {
/* On non-MinGW Windows the instantiations are already marked with extern
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_SHADERTOOLS_EXPORT_HPP MAGNUM_SHADERTOOLS_EXPORT
#else
#define MAGNUM_SHADERTOOLS_EXPORT_HPP
#endif
template class MAGNUM_SHADERTOOLS_EXPORT_HPP Manager<Magnum::ShaderTools::AbstractConverter>;
template class MAGNUM_SHADERTOOLS_EXPORT Manager<Magnum::ShaderTools::AbstractConverter>;
}}

10
src/Magnum/Text/AbstractFont.cpp

@ -45,15 +45,7 @@
namespace Corrade { namespace PluginManager {
/* On non-MinGW Windows the instantiations are already marked with extern
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_TEXT_EXPORT_HPP MAGNUM_TEXT_EXPORT
#else
#define MAGNUM_TEXT_EXPORT_HPP
#endif
template class MAGNUM_TEXT_EXPORT_HPP Manager<Magnum::Text::AbstractFont>;
template class MAGNUM_TEXT_EXPORT Manager<Magnum::Text::AbstractFont>;
}}

10
src/Magnum/Text/AbstractFontConverter.cpp

@ -45,15 +45,7 @@
namespace Corrade { namespace PluginManager {
/* On non-MinGW Windows the instantiations are already marked with extern
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_TEXT_EXPORT_HPP MAGNUM_TEXT_EXPORT
#else
#define MAGNUM_TEXT_EXPORT_HPP
#endif
template class MAGNUM_TEXT_EXPORT_HPP Manager<Magnum::Text::AbstractFontConverter>;
template class MAGNUM_TEXT_EXPORT Manager<Magnum::Text::AbstractFontConverter>;
}}

10
src/Magnum/Trade/AbstractImageConverter.cpp

@ -46,15 +46,7 @@
namespace Corrade { namespace PluginManager {
/* On non-MinGW Windows the instantiations are already marked with extern
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_TRADE_EXPORT_HPP MAGNUM_TRADE_EXPORT
#else
#define MAGNUM_TRADE_EXPORT_HPP
#endif
template class MAGNUM_TRADE_EXPORT_HPP Manager<Magnum::Trade::AbstractImageConverter>;
template class MAGNUM_TRADE_EXPORT Manager<Magnum::Trade::AbstractImageConverter>;
}}

10
src/Magnum/Trade/AbstractImporter.cpp

@ -72,15 +72,7 @@
namespace Corrade { namespace PluginManager {
/* On non-MinGW Windows the instantiations are already marked with extern
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_TRADE_EXPORT_HPP MAGNUM_TRADE_EXPORT
#else
#define MAGNUM_TRADE_EXPORT_HPP
#endif
template class MAGNUM_TRADE_EXPORT_HPP Manager<Magnum::Trade::AbstractImporter>;
template class MAGNUM_TRADE_EXPORT Manager<Magnum::Trade::AbstractImporter>;
}}

10
src/Magnum/Trade/AbstractSceneConverter.cpp

@ -46,15 +46,7 @@
namespace Corrade { namespace PluginManager {
/* On non-MinGW Windows the instantiations are already marked with extern
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_TRADE_EXPORT_HPP MAGNUM_TRADE_EXPORT
#else
#define MAGNUM_TRADE_EXPORT_HPP
#endif
template class MAGNUM_TRADE_EXPORT_HPP Manager<Magnum::Trade::AbstractSceneConverter>;
template class MAGNUM_TRADE_EXPORT Manager<Magnum::Trade::AbstractSceneConverter>;
}}

Loading…
Cancel
Save