From d48293c07f55b74b4771ffd8f76c6ed77b6873cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 1 Apr 2018 10:42:53 +0200 Subject: [PATCH] Don't compile pluginSearchPaths() on platforms that don't need it. --- src/Magnum/Audio/AbstractImporter.cpp | 4 ++++ src/Magnum/Audio/AbstractImporter.h | 5 +++++ src/Magnum/Audio/CMakeLists.txt | 6 ++++-- src/Magnum/Text/AbstractFont.cpp | 4 ++++ src/Magnum/Text/AbstractFont.h | 5 +++++ src/Magnum/Text/AbstractFontConverter.cpp | 4 ++++ src/Magnum/Text/AbstractFontConverter.h | 5 +++++ src/Magnum/Text/CMakeLists.txt | 6 ++++-- src/Magnum/Trade/AbstractImageConverter.cpp | 5 +++++ src/Magnum/Trade/AbstractImageConverter.h | 5 +++++ src/Magnum/Trade/AbstractImporter.cpp | 5 +++++ src/Magnum/Trade/AbstractImporter.h | 5 +++++ src/Magnum/Trade/CMakeLists.txt | 6 ++++-- 13 files changed, 59 insertions(+), 6 deletions(-) diff --git a/src/Magnum/Audio/AbstractImporter.cpp b/src/Magnum/Audio/AbstractImporter.cpp index 3f8254759..a17d89dd7 100644 --- a/src/Magnum/Audio/AbstractImporter.cpp +++ b/src/Magnum/Audio/AbstractImporter.cpp @@ -29,7 +29,9 @@ #include #include +#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT #include "Magnum/Audio/configure.h" +#endif namespace Magnum { namespace Audio { @@ -37,6 +39,7 @@ std::string AbstractImporter::pluginInterface() { return "cz.mosra.magnum.Audio.AbstractImporter/0.1"; } +#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT std::vector AbstractImporter::pluginSearchPaths() { return { #ifdef CORRADE_IS_DEBUG_BUILD @@ -48,6 +51,7 @@ std::vector AbstractImporter::pluginSearchPaths() { #endif }; } +#endif AbstractImporter::AbstractImporter() = default; diff --git a/src/Magnum/Audio/AbstractImporter.h b/src/Magnum/Audio/AbstractImporter.h index 2ec9d71c9..31e9e857a 100644 --- a/src/Magnum/Audio/AbstractImporter.h +++ b/src/Magnum/Audio/AbstractImporter.h @@ -93,6 +93,7 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi */ static std::string pluginInterface(); + #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** * @brief Plugin search paths * @@ -103,8 +104,12 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi * system-wide plugin search directory is configurable using the * `MAGNUM_PLUGINS_DIR` CMake variables, see @ref building for more * information. + * + * Not defined on platforms without + * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ static std::vector pluginSearchPaths(); + #endif /** @brief Default constructor */ explicit AbstractImporter(); diff --git a/src/Magnum/Audio/CMakeLists.txt b/src/Magnum/Audio/CMakeLists.txt index 046141159..7f4bbc3c3 100644 --- a/src/Magnum/Audio/CMakeLists.txt +++ b/src/Magnum/Audio/CMakeLists.txt @@ -44,8 +44,10 @@ set(MagnumAudio_HEADERS visibility.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/configure.h) +if(NOT CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/configure.h) +endif() if(WITH_SCENEGRAPH) list(APPEND MagnumAudio_HEADERS diff --git a/src/Magnum/Text/AbstractFont.cpp b/src/Magnum/Text/AbstractFont.cpp index 2026bb514..2680dd845 100644 --- a/src/Magnum/Text/AbstractFont.cpp +++ b/src/Magnum/Text/AbstractFont.cpp @@ -32,7 +32,9 @@ #include "Magnum/Math/Functions.h" #include "Magnum/Text/GlyphCache.h" +#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT #include "Magnum/Text/configure.h" +#endif namespace Magnum { namespace Text { @@ -40,6 +42,7 @@ std::string AbstractFont::pluginInterface() { return "cz.mosra.magnum.Text.AbstractFont/0.2.4"; } +#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT std::vector AbstractFont::pluginSearchPaths() { return { #ifdef CORRADE_IS_DEBUG_BUILD @@ -51,6 +54,7 @@ std::vector AbstractFont::pluginSearchPaths() { #endif }; } +#endif AbstractFont::AbstractFont(): _size(0.0f) {} diff --git a/src/Magnum/Text/AbstractFont.h b/src/Magnum/Text/AbstractFont.h index 0911a1fcf..d55c6f369 100644 --- a/src/Magnum/Text/AbstractFont.h +++ b/src/Magnum/Text/AbstractFont.h @@ -109,6 +109,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { */ static std::string pluginInterface(); + #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** * @brief Plugin search paths * @@ -118,8 +119,12 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * `bin/` on Windows). The system-wide plugin search directory is * configurable using the `MAGNUM_PLUGINS_DIR` CMake variables, see * @ref building for more information. + * + * Not defined on platforms without + * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ static std::vector pluginSearchPaths(); + #endif /** @brief Default constructor */ explicit AbstractFont(); diff --git a/src/Magnum/Text/AbstractFontConverter.cpp b/src/Magnum/Text/AbstractFontConverter.cpp index 1c5245490..ea95dbbf1 100644 --- a/src/Magnum/Text/AbstractFontConverter.cpp +++ b/src/Magnum/Text/AbstractFontConverter.cpp @@ -33,7 +33,9 @@ #include "Magnum/Text/GlyphCache.h" +#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT #include "Magnum/Text/configure.h" +#endif namespace Magnum { namespace Text { @@ -57,6 +59,7 @@ std::string AbstractFontConverter::pluginInterface() { return "cz.mosra.magnum.Text.AbstractFontConverter/0.1.2"; } +#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT std::vector AbstractFontConverter::pluginSearchPaths() { return { #ifdef CORRADE_IS_DEBUG_BUILD @@ -68,6 +71,7 @@ std::vector AbstractFontConverter::pluginSearchPaths() { #endif }; } +#endif AbstractFontConverter::AbstractFontConverter() = default; diff --git a/src/Magnum/Text/AbstractFontConverter.h b/src/Magnum/Text/AbstractFontConverter.h index 974e9dedd..43b7d70b8 100644 --- a/src/Magnum/Text/AbstractFontConverter.h +++ b/src/Magnum/Text/AbstractFontConverter.h @@ -135,6 +135,7 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl */ static std::string pluginInterface(); + #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** * @brief Plugin search paths * @@ -145,8 +146,12 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl * system-wide plugin search directory is configurable using the * `MAGNUM_PLUGINS_DIR` CMake variables, see @ref building for more * information. + * + * Not defined on platforms without + * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ static std::vector pluginSearchPaths(); + #endif /** @brief Default constructor */ explicit AbstractFontConverter(); diff --git a/src/Magnum/Text/CMakeLists.txt b/src/Magnum/Text/CMakeLists.txt index 7634f6da8..8a55561f4 100644 --- a/src/Magnum/Text/CMakeLists.txt +++ b/src/Magnum/Text/CMakeLists.txt @@ -40,8 +40,10 @@ set(MagnumText_HEADERS visibility.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/configure.h) +if(NOT CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/configure.h) +endif() # Text library add_library(MagnumText ${SHARED_OR_STATIC} diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index c3ac84f70..c1614481e 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -31,7 +31,10 @@ #include "Magnum/Image.h" #include "Magnum/Trade/ImageData.h" + +#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT #include "Magnum/Trade/configure.h" +#endif namespace Magnum { namespace Trade { @@ -39,6 +42,7 @@ std::string AbstractImageConverter::pluginInterface() { return "cz.mosra.magnum.Trade.AbstractImageConverter/0.2.1"; } +#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT std::vector AbstractImageConverter::pluginSearchPaths() { return { #ifdef CORRADE_IS_DEBUG_BUILD @@ -50,6 +54,7 @@ std::vector AbstractImageConverter::pluginSearchPaths() { #endif }; } +#endif AbstractImageConverter::AbstractImageConverter() = default; diff --git a/src/Magnum/Trade/AbstractImageConverter.h b/src/Magnum/Trade/AbstractImageConverter.h index 06c735602..a7397efe6 100644 --- a/src/Magnum/Trade/AbstractImageConverter.h +++ b/src/Magnum/Trade/AbstractImageConverter.h @@ -123,6 +123,7 @@ class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractManagi */ static std::string pluginInterface(); + #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** * @brief Plugin search paths * @@ -133,8 +134,12 @@ class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractManagi * system-wide plugin search directory is configurable using the * `MAGNUM_PLUGINS_DIR` CMake variables, see @ref building for more * information. + * + * Not defined on platforms without + * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ static std::vector pluginSearchPaths(); + #endif /** @brief Default constructor */ explicit AbstractImageConverter(); diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index 0eb13ba41..03ae5be26 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -40,7 +40,10 @@ #include "Magnum/Trade/ObjectData3D.h" #include "Magnum/Trade/SceneData.h" #include "Magnum/Trade/TextureData.h" + +#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT #include "Magnum/Trade/configure.h" +#endif namespace Magnum { namespace Trade { @@ -48,6 +51,7 @@ std::string AbstractImporter::pluginInterface() { return "cz.mosra.magnum.Trade.AbstractImporter/0.3"; } +#ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT std::vector AbstractImporter::pluginSearchPaths() { return { #ifdef CORRADE_IS_DEBUG_BUILD @@ -59,6 +63,7 @@ std::vector AbstractImporter::pluginSearchPaths() { #endif }; } +#endif AbstractImporter::AbstractImporter() = default; diff --git a/src/Magnum/Trade/AbstractImporter.h b/src/Magnum/Trade/AbstractImporter.h index daf925346..191caa6d0 100644 --- a/src/Magnum/Trade/AbstractImporter.h +++ b/src/Magnum/Trade/AbstractImporter.h @@ -113,6 +113,7 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlug */ static std::string pluginInterface(); + #ifndef CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT /** * @brief Plugin search paths * @@ -122,8 +123,12 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlug * Unix-like systems, `bin/` on Windows). The system-wide plugin search * directory is configurable using the `MAGNUM_PLUGINS_DIR` CMake * variables, see @ref building for more information. + * + * Not defined on platforms without + * @ref CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT "dynamic plugin support". */ static std::vector pluginSearchPaths(); + #endif /** @brief Default constructor */ explicit AbstractImporter(); diff --git a/src/Magnum/Trade/CMakeLists.txt b/src/Magnum/Trade/CMakeLists.txt index 108924c12..f148e3a78 100644 --- a/src/Magnum/Trade/CMakeLists.txt +++ b/src/Magnum/Trade/CMakeLists.txt @@ -41,8 +41,10 @@ set(MagnumTrade_HEADERS TextureData.h Trade.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/configure.h) +if(NOT CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/configure.h) +endif() # Force IDEs to display all header files in project view add_custom_target(MagnumTrade SOURCES ${MagnumTrade_HEADERS})