From a67d24a34e81309fae3c093462ffc2925ab49b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20W=C5=82ostowski?= Date: Sat, 4 Nov 2017 21:00:42 +0100 Subject: [PATCH] revert link-time plugin registration causing plugins to be incorrectly enumerated --- pcbnew/eagle_plugin.cpp | 4 ---- pcbnew/github/github_plugin.cpp | 4 ---- pcbnew/gpcb_plugin.cpp | 4 ---- pcbnew/io_mgr.cpp | 7 +++++++ pcbnew/kicad_plugin.cpp | 4 ---- pcbnew/legacy_plugin.cpp | 4 ---- pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp | 4 ---- qa/pcb_test_window/CMakeLists.txt | 4 +++- 8 files changed, 10 insertions(+), 25 deletions(-) diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index 9b9ca3c69e..8814bf5c58 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -2254,7 +2254,3 @@ bool EAGLE_PLUGIN::IsFootprintLibWritable( const wxString& aLibraryPath ) } */ - -namespace { - static IO_MGR::REGISTER_PLUGIN registerSelf( IO_MGR::EAGLE, wxT("Eagle"), []() -> PLUGIN* { return new EAGLE_PLUGIN; } ); -}; diff --git a/pcbnew/github/github_plugin.cpp b/pcbnew/github/github_plugin.cpp index 0e59707ecb..29fca902ed 100644 --- a/pcbnew/github/github_plugin.cpp +++ b/pcbnew/github/github_plugin.cpp @@ -594,10 +594,6 @@ void GITHUB_PLUGIN::remoteGetZip( const wxString& aRepoURL ) } } -namespace { - static IO_MGR::REGISTER_PLUGIN registerSelf( IO_MGR::GITHUB, wxT("Github"), []() -> PLUGIN* { return new GITHUB_PLUGIN; } ); -}; - #if 0 && defined(STANDALONE) int main( int argc, char** argv ) diff --git a/pcbnew/gpcb_plugin.cpp b/pcbnew/gpcb_plugin.cpp index e1a6bd8450..2c123bf59a 100644 --- a/pcbnew/gpcb_plugin.cpp +++ b/pcbnew/gpcb_plugin.cpp @@ -1141,7 +1141,3 @@ bool GPCB_PLUGIN::IsFootprintLibWritable( const wxString& aLibraryPath ) return m_cache->IsWritable(); } - -namespace { - static IO_MGR::REGISTER_PLUGIN registerSelf( IO_MGR::GEDA_PCB, wxT("GEDA/Pcb"), []() -> PLUGIN* { return new GPCB_PLUGIN; } ); -}; diff --git a/pcbnew/io_mgr.cpp b/pcbnew/io_mgr.cpp index fc7773c837..e3e52ba072 100644 --- a/pcbnew/io_mgr.cpp +++ b/pcbnew/io_mgr.cpp @@ -204,3 +204,10 @@ void IO_MGR::Save( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aBoar THROW_IO_ERROR( wxString::Format( FMT_NOTFOUND, ShowType( aFileType ).GetData() ) ); } + +static IO_MGR::REGISTER_PLUGIN registerEaglePlugin( IO_MGR::EAGLE, wxT("Eagle"), []() -> PLUGIN* { return new EAGLE_PLUGIN; } ); +static IO_MGR::REGISTER_PLUGIN registerKicadPlugin( IO_MGR::KICAD_SEXP, wxT("KiCad"), []() -> PLUGIN* { return new PCB_IO; } ); +static IO_MGR::REGISTER_PLUGIN registerPcadPlugin( IO_MGR::PCAD, wxT("P-Cad"), []() -> PLUGIN* { return new PCAD_PLUGIN; } ); +static IO_MGR::REGISTER_PLUGIN registerGithubPlugin( IO_MGR::GITHUB, wxT("Github"), []() -> PLUGIN* { return new GITHUB_PLUGIN; } ); +static IO_MGR::REGISTER_PLUGIN registerLegacyPlugin( IO_MGR::LEGACY, wxT("Legacy"), []() -> PLUGIN* { return new LEGACY_PLUGIN; } ); +static IO_MGR::REGISTER_PLUGIN registerGPCBPlugin( IO_MGR::GEDA_PCB, wxT("GEDA/Pcb"), []() -> PLUGIN* { return new GPCB_PLUGIN; } ); diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 7d76413e5a..0abb0806e9 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -2214,7 +2214,3 @@ bool PCB_IO::IsFootprintLibWritable( const wxString& aLibraryPath ) return m_cache->IsWritable(); } - -namespace { - static IO_MGR::REGISTER_PLUGIN registerSelf( IO_MGR::KICAD_SEXP, wxT("KiCad"), []() -> PLUGIN* { return new PCB_IO; } ); -}; diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index 7275627377..4c73bc3439 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -3505,7 +3505,3 @@ LEGACY_PLUGIN::~LEGACY_PLUGIN() delete m_cache; delete m_mapping; } - -namespace { - static IO_MGR::REGISTER_PLUGIN registerSelf( IO_MGR::LEGACY, wxT("Legacy"), []() -> PLUGIN* { return new LEGACY_PLUGIN; } ); -}; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp b/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp index 6945d7eb38..0c7c75c974 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcad_plugin.cpp @@ -89,7 +89,3 @@ BOARD* PCAD_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, const P return m_board; } - -namespace { - static IO_MGR::REGISTER_PLUGIN registerSelf( IO_MGR::PCAD, wxT("P-Cad"), []() -> PLUGIN* { return new PCAD_PLUGIN; } ); -}; diff --git a/qa/pcb_test_window/CMakeLists.txt b/qa/pcb_test_window/CMakeLists.txt index 743755a5f3..c3fa4ebc1e 100644 --- a/qa/pcb_test_window/CMakeLists.txt +++ b/qa/pcb_test_window/CMakeLists.txt @@ -27,7 +27,7 @@ find_package( wxWidgets 3.0.0 COMPONENTS gl aui adv html core net base xml stc R add_definitions(-DBOOST_TEST_DYN_LINK -DPCBNEW) -add_dependencies( pnsrouter pcbcommon ) +add_dependencies( pnsrouter pcbcommon pcad2kicadpcb github_plugin ) add_executable(test_window test.cpp @@ -80,6 +80,8 @@ target_link_libraries( test_window pcbcommon bitmaps gal + pcad2kicadpcb + github_plugin ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}