From 3dc03bb81d780b55c2b2f3f2eb6c7c41bc12c325 Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Mon, 5 Jun 2017 17:42:46 -0400 Subject: [PATCH] Remove old codegen #1157 --- external_plugins/CMakeLists.txt | 6 ---- libraries/manifest/external_plugins.cpp | 1 - libraries/manifest/internal_plugins.cpp | 1 - libraries/manifest/mf_plugins.cpp | 43 ------------------------- libraries/plugins/CMakeLists.txt | 2 -- 5 files changed, 53 deletions(-) delete mode 100644 libraries/manifest/external_plugins.cpp delete mode 100644 libraries/manifest/internal_plugins.cpp delete mode 100644 libraries/manifest/mf_plugins.cpp diff --git a/external_plugins/CMakeLists.txt b/external_plugins/CMakeLists.txt index d0f11ab492..6b4e26333b 100644 --- a/external_plugins/CMakeLists.txt +++ b/external_plugins/CMakeLists.txt @@ -1,16 +1,10 @@ # for each subdirectory containing a CMakeLists.txt, add that subdirectory -set( ENV{STEEMIT_EXTERNAL_PLUGINS} "" ) file( GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * ) foreach( child ${children} ) if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${child}" ) if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${child}/CMakeLists.txt" ) add_subdirectory( "${child}" ) - set( ENV{STEEMIT_EXTERNAL_PLUGINS} $ENV{STEEMIT_EXTERNAL_PLUGINS} ${child} ) endif() endif() endforeach() - -# add_subdirectory( hello_api ) -# add_subdirectory( hello_arguments ) -# add_subdirectory( hello_objects ) \ No newline at end of file diff --git a/libraries/manifest/external_plugins.cpp b/libraries/manifest/external_plugins.cpp deleted file mode 100644 index beaf2ef5bd..0000000000 --- a/libraries/manifest/external_plugins.cpp +++ /dev/null @@ -1 +0,0 @@ -// this empty source file is part of the cmake hackery to build a lib containing all plugins diff --git a/libraries/manifest/internal_plugins.cpp b/libraries/manifest/internal_plugins.cpp deleted file mode 100644 index beaf2ef5bd..0000000000 --- a/libraries/manifest/internal_plugins.cpp +++ /dev/null @@ -1 +0,0 @@ -// this empty source file is part of the cmake hackery to build a lib containing all plugins diff --git a/libraries/manifest/mf_plugins.cpp b/libraries/manifest/mf_plugins.cpp deleted file mode 100644 index 74cce72059..0000000000 --- a/libraries/manifest/mf_plugins.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include - -#include -#include -#include - -#define STEEMIT_DECLARE_PLUGIN_CREATOR( r, data, x ) \ - std::shared_ptr< steemit::app::abstract_plugin > BOOST_PP_CAT( create_, BOOST_PP_CAT( x, _plugin ) )( steemit::app::application* app ); - -namespace steemit { namespace plugin { - -BOOST_PP_SEQ_FOR_EACH( STEEMIT_DECLARE_PLUGIN_CREATOR, _, STEEMIT_INTERNAL_PLUGIN_LIST ) -BOOST_PP_SEQ_FOR_EACH( STEEMIT_DECLARE_PLUGIN_CREATOR, _, STEEMIT_EXTERNAL_PLUGIN_LIST ) - -boost::container::flat_map< std::string, std::function< std::shared_ptr< steemit::app::abstract_plugin >( steemit::app::application* app ) > > plugin_factories_by_name; - -#define STEEMIT_REGISTER_PLUGIN_FACTORY( r, data, x ) \ - plugin_factories_by_name[ #x ] = []( steemit::app::application* app ) -> std::shared_ptr< steemit::app::abstract_plugin >{ return BOOST_PP_CAT( create_, BOOST_PP_CAT( x, _plugin( app ) ) ); }; - -void initialize_plugin_factories() -{ - BOOST_PP_SEQ_FOR_EACH( STEEMIT_REGISTER_PLUGIN_FACTORY, _, STEEMIT_INTERNAL_PLUGIN_LIST ) - BOOST_PP_SEQ_FOR_EACH( STEEMIT_REGISTER_PLUGIN_FACTORY, _, STEEMIT_EXTERNAL_PLUGIN_LIST ) -} - -std::shared_ptr< steemit::app::abstract_plugin > create_plugin( const std::string& name, steemit::app::application* app ) -{ - auto it = plugin_factories_by_name.find( name ); - if( it == plugin_factories_by_name.end() ) - return std::shared_ptr< steemit::app::abstract_plugin >(); - return it->second( app ); -} - -std::vector< std::string > get_available_plugins() -{ - std::vector< std::string > result; - for( const auto& e : plugin_factories_by_name ) - result.push_back( e.first ); - return result; -} - -} } diff --git a/libraries/plugins/CMakeLists.txt b/libraries/plugins/CMakeLists.txt index ab0cf557cc..6b4e26333b 100644 --- a/libraries/plugins/CMakeLists.txt +++ b/libraries/plugins/CMakeLists.txt @@ -1,12 +1,10 @@ # for each subdirectory containing a CMakeLists.txt, add that subdirectory -set( ENV{STEEMIT_INTERNAL_PLUGINS} "" ) file( GLOB children RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} * ) foreach( child ${children} ) if( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${child}" ) if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${child}/CMakeLists.txt" ) add_subdirectory( "${child}" ) - set( ENV{STEEMIT_INTERNAL_PLUGINS} "$ENV{STEEMIT_INTERNAL_PLUGINS};${child}" ) endif() endif() endforeach()