From 035af64b95bb79834e358f837e9e9ccef0096176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 14 Mar 2022 22:01:55 +0100 Subject: [PATCH] Work around clang-cl needing full definitions for extern template. I wanted to avoid including extra stuff with the Manager.hpp split, but this would make it even worse than having Array and String included unconditionally. Fortunately it's enough to simply not even have the declaration. --- src/Magnum/Audio/AbstractImporter.h | 4 +++- src/Magnum/ShaderTools/AbstractConverter.h | 4 +++- src/Magnum/Text/AbstractFont.h | 4 +++- src/Magnum/Text/AbstractFontConverter.h | 4 +++- src/Magnum/Trade/AbstractImageConverter.h | 4 +++- src/Magnum/Trade/AbstractImporter.h | 4 +++- src/Magnum/Trade/AbstractSceneConverter.h | 5 +++-- 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/Magnum/Audio/AbstractImporter.h b/src/Magnum/Audio/AbstractImporter.h index cd6e2777c..bbcc83bfe 100644 --- a/src/Magnum/Audio/AbstractImporter.h +++ b/src/Magnum/Audio/AbstractImporter.h @@ -235,7 +235,9 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi }} -#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +/* clang-cl complains about "explicit instantiation of undefined template" + here, so don't define anything */ +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) && !defined(CORRADE_TARGET_CLANG_CL) namespace Corrade { namespace PluginManager { extern template class MAGNUM_AUDIO_EXPORT Manager; }} diff --git a/src/Magnum/ShaderTools/AbstractConverter.h b/src/Magnum/ShaderTools/AbstractConverter.h index 0b29904bc..f3fbcdf04 100644 --- a/src/Magnum/ShaderTools/AbstractConverter.h +++ b/src/Magnum/ShaderTools/AbstractConverter.h @@ -1148,7 +1148,9 @@ template void AbstractConverter::setInputFileCallback(C }} -#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +/* clang-cl complains about "explicit instantiation of undefined template" + here, so don't define anything */ +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) && !defined(CORRADE_TARGET_CLANG_CL) namespace Corrade { namespace PluginManager { extern template class MAGNUM_SHADERTOOLS_EXPORT Manager; }} diff --git a/src/Magnum/Text/AbstractFont.h b/src/Magnum/Text/AbstractFont.h index d983e5b00..d79fa07a8 100644 --- a/src/Magnum/Text/AbstractFont.h +++ b/src/Magnum/Text/AbstractFont.h @@ -649,7 +649,9 @@ template void AbstractFont::setFileCallback(Callback ca }} -#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +/* clang-cl complains about "explicit instantiation of undefined template" + here, so don't define anything */ +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) && !defined(CORRADE_TARGET_CLANG_CL) namespace Corrade { namespace PluginManager { extern template class MAGNUM_TEXT_EXPORT Manager; }} diff --git a/src/Magnum/Text/AbstractFontConverter.h b/src/Magnum/Text/AbstractFontConverter.h index 58e39c1c6..d1d487061 100644 --- a/src/Magnum/Text/AbstractFontConverter.h +++ b/src/Magnum/Text/AbstractFontConverter.h @@ -410,7 +410,9 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl }} -#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +/* clang-cl complains about "explicit instantiation of undefined template" + here, so don't define anything */ +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) && !defined(CORRADE_TARGET_CLANG_CL) namespace Corrade { namespace PluginManager { extern template class MAGNUM_TEXT_EXPORT Manager; }} diff --git a/src/Magnum/Trade/AbstractImageConverter.h b/src/Magnum/Trade/AbstractImageConverter.h index 61172cc15..bc7bf0194 100644 --- a/src/Magnum/Trade/AbstractImageConverter.h +++ b/src/Magnum/Trade/AbstractImageConverter.h @@ -1735,7 +1735,9 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract }} -#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +/* clang-cl complains about "explicit instantiation of undefined template" + here, so don't define anything */ +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) && !defined(CORRADE_TARGET_CLANG_CL) namespace Corrade { namespace PluginManager { extern template class MAGNUM_TRADE_EXPORT Manager; }} diff --git a/src/Magnum/Trade/AbstractImporter.h b/src/Magnum/Trade/AbstractImporter.h index f87a89c4a..2f387fade 100644 --- a/src/Magnum/Trade/AbstractImporter.h +++ b/src/Magnum/Trade/AbstractImporter.h @@ -2540,7 +2540,9 @@ template void AbstractImporter::setFileCallback(Callbac }} -#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +/* clang-cl complains about "explicit instantiation of undefined template" + here, so don't define anything */ +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) && !defined(CORRADE_TARGET_CLANG_CL) namespace Corrade { namespace PluginManager { extern template class MAGNUM_TRADE_EXPORT Manager; }} diff --git a/src/Magnum/Trade/AbstractSceneConverter.h b/src/Magnum/Trade/AbstractSceneConverter.h index 4bcf873e1..e593c36e3 100644 --- a/src/Magnum/Trade/AbstractSceneConverter.h +++ b/src/Magnum/Trade/AbstractSceneConverter.h @@ -449,8 +449,9 @@ class MAGNUM_TRADE_EXPORT AbstractSceneConverter: public PluginManager::Abstract }; }} - -#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) +/* clang-cl complains about "explicit instantiation of undefined template" + here, so don't define anything */ +#if defined(CORRADE_TARGET_WINDOWS) && !(defined(CORRADE_TARGET_MINGW) && !defined(CORRADE_TARGET_CLANG)) && !defined(CORRADE_TARGET_CLANG_CL) namespace Corrade { namespace PluginManager { extern template class MAGNUM_TRADE_EXPORT Manager; }}